Add kaya-openapi package for automatic OpenAPI spec generation
CI / Build Pip package (push) Successful in 2m49s
CI / Build Pip package (push) Successful in 2m49s
- New packages/kaya-openapi with OpenAPIMixin, @operation decorator, and generate_spec() that walks the routing tree - Enables kaya-core's Tree.register to expose the original handler callback as an instance attribute for metadata introspection - Registers GET /openapi.json and GET /docs (Swagger UI) routes - Supports and path parameters, docstring descriptions, @operation metadata, and excludes wildcard/WS routes - Adds example/openapi.py, updates CI, README, and requirements
This commit is contained in:
@@ -48,6 +48,10 @@ jobs:
|
||||
run: |
|
||||
.venv/bin/python -m mypy -p kaya.oidc
|
||||
.venv/bin/python -m unittest discover -s packages/kaya-oidc/tests
|
||||
- name: Check kaya-openapi
|
||||
run: |
|
||||
.venv/bin/python -m mypy -p kaya.openapi
|
||||
.venv/bin/python -m unittest discover -s packages/kaya-openapi/tests
|
||||
- name: Publish kaya-core artifacts
|
||||
env:
|
||||
TWINE_REPOSITORY_URL: ${{ vars.PYPI_REGISTRY_URL }}
|
||||
@@ -96,3 +100,11 @@ jobs:
|
||||
run: |
|
||||
.venv/bin/pyproject-build packages/kaya-oidc
|
||||
.venv/bin/twine upload --repository gitea packages/kaya-oidc/dist/*.whl packages/kaya-oidc/dist/*.tar.gz
|
||||
- name: Publish kaya-openapi artifacts
|
||||
env:
|
||||
TWINE_REPOSITORY_URL: ${{ vars.PYPI_REGISTRY_URL }}
|
||||
TWINE_USERNAME: ${{ vars.PUBLISHER_USERNAME }}
|
||||
TWINE_PASSWORD: ${{ secrets.PUBLISHER_TOKEN }}
|
||||
run: |
|
||||
.venv/bin/pyproject-build packages/kaya-openapi
|
||||
.venv/bin/twine upload --repository gitea packages/kaya-openapi/dist/*.whl packages/kaya-openapi/dist/*.tar.gz
|
||||
|
||||
Reference in New Issue
Block a user