Skip to content

Commit d3528eb

Browse files
authored
Daily fix (#1)
1 parent 2a44bba commit d3528eb

File tree

10 files changed

+17
-59
lines changed

10 files changed

+17
-59
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ jobs:
2121
git config --local user.email "action@github.com"
2222
git config --local user.name "GitHub Action"
2323
git fetch origin gh-pages:gh-pages
24-
uv run mike deploy v0.9.x
24+
uv run mike deploy v0.x latest --update-aliases
2525
git push origin gh-pages

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</a>
66
</div>
77
<p align="center">
8-
<em>A simple API framework based on Starlette.</em>
8+
<em>A simple async API framework based on Starlette.</em>
99
</p>
1010
<p align="center">
1111
<a href="https://github.com/luolingchun/star-openapi/actions/workflows/tests.yml" target="_blank">
@@ -36,6 +36,8 @@ The key features are:
3636

3737
- **Data validation:** Fast data verification based on [Pydantic](https://github.com/pydantic/pydantic)
3838

39+
- **Websocket**: Support for websocket
40+
3941
## Requirements
4042

4143
Python 3.11+

docs/Example.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ if __name__ == "__main__":
180180
uvicorn.run(app, host="127.0.0.1", port=8000)
181181
```
182182

183-
## APIBlueprint
183+
## APIRouter
184184

185185
```python
186186
from pydantic import BaseModel, Field

docs/Usage/Request.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ Receive request headers.
7777

7878
Receive request cookies.
7979

80+
### request
81+
82+
Receive request from **starlette.requests.Request**.
8083

8184
## Request model
8285

examples/simple_demo.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ class TestModel(BaseModel):
1515
age: int
1616

1717

18-
@app.post("/book", summary="get books", tags=[book_tag])
19-
async def create_user(body: TestModel):
18+
@app.get("/book", summary="get books", tags=[book_tag])
19+
async def get_book(query: TestModel):
2020
"""
2121
get all books
2222
"""
23-
print(body.model_dump_json())
23+
print(query.model_dump_json())
2424
return JSONResponse({"message": "Hello World"})
2525

26+
2627
if __name__ == "__main__":
2728
print(app.routes)
2829
uvicorn.run(app)

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[project]
22
name = "star-openapi"
33
dynamic = ["version"]
4-
description = "A simple API framework based on Starlette."
4+
description = "A simple async API framework based on Starlette."
5+
readme = "README.md"
56
maintainers = [{ name = "llc", email = "luolingchun@outlook.com" }]
67
license = "MIT"
78
license-files = ["LICENSE"]
@@ -31,8 +32,6 @@ dependencies = [
3132
"jinja2>=3.1.2",
3233
"uvicorn[standard]>=0.40.0",
3334
"click>=8.0.0",
34-
"cython>=3.2.3",
35-
"setuptools>=80.9.0",
3635
]
3736

3837
[project.optional-dependencies]

star_openapi/openapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def register_api(self, api: APIRouter):
254254

255255
self.paths.update(**api.paths)
256256

257-
# Update component schemas with the APIBlueprint's component schemas
257+
# Update component schemas with the APIRouter's component schemas
258258
self.components_schemas.update(**api.components_schemas)
259259

260260
# Register the APIRouter with the current instance

star_openapi/router.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def register_api(self, api: "APIRouter"):
6262

6363
self.paths.update(**api.paths)
6464

65-
# Update component schemas with the APIBlueprint's component schemas
65+
# Update component schemas with the APIRouter's component schemas
6666
self.components_schemas.update(**api.components_schemas)
6767

6868
# Register the APIRouter with the current instance

star_openapi/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_operation_id_for_path(*, url_prefix: str = "", name: str = "", path: str
8989
Generate a unique operation ID based on the name, path, and method.
9090
9191
Args:
92-
url_prefix: The Blueprint name
92+
url_prefix: The APIRouter name
9393
name: The name or identifier for the operation.
9494
path: The URL path for the operation.
9595
method: The HTTP method for the operation.

uv.lock

Lines changed: 0 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)