Add apidocs with pages and health#925
Open
audreyfeldroy wants to merge 11 commits intofeldroy:mainfrom
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
pygarap
reviewed
Dec 26, 2025
src/air/applications.py
Outdated
| from .routing import AirRoute, RouteCallable, RouterMixin | ||
| from .types import MaybeAwaitable | ||
|
|
||
| AIR_VERSION = get_version("air") |
There was a problem hiding this comment.
Can you please put these new constants in src/air/constants.py?
src/air/applications.py
Outdated
| """ | ||
| ), | ||
| ] = None, | ||
| ] = "/_swagger", |
src/air/applications.py
Outdated
| """ | ||
| ), | ||
| ] = None, | ||
| ] = "/_redoc", |
src/air/applications.py
Outdated
| """ | ||
| ), | ||
| ] = None, | ||
| ] = "/openapi.json", |
Member
Author
|
Added named constants for the URLs — good call on improving readability: DEFAULT_SWAGGER_URL = "/_swagger"
DEFAULT_REDOC_URL = "/_redoc"
DEFAULT_OPENAPI_URL = "/openapi.json"Keeping them in |
Member
Author
|
@pygarap After considering it more, I've moved the shared constants to constants.py. Module-specific constants will remain for locality until they become shared, then moved. |
4ac68d1 to
06eb76c
Compare
Introduces a default /health endpoint returning status 'ok' as JSON in Air applications. Updates default OpenAPI metadata and tags, and adds a test to verify the health endpoint.
Changed the default API documentation URL from /docs to /_docs in both the application and CLI. Updated the default description to reference FastAPI and link to the Air documentation site.
Revised the docstring to clarify the purpose of shared constants and note that module-specific constants are kept with their respective consumers.
Moved default title and attribution strings to constants.py for reuse. Updated application and CLI to use these constants, and improved the default API description for clarity and branding consistency.
06eb76c to
2a96fb2
Compare
We need this in order to test the Air CLI
Eliminated the internal _load_app and _add_healthcheck_route functions from the CLI. The run command now passes the app path directly to uvicorn, simplifying the startup process and removing custom FastAPI healthcheck injection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a built-in
/healthendpoint and enables FastAPI's built-in API docs, providing foundational API infrastructure to Air applications.Summary
/healthendpoint - Returns{"status": "ok"}JSON for load balancers, Kubernetes probes, and uptime monitors/_swagger, ReDoc at/_redoc(underscore prefix keeps/docsfree for user content)tags=["pages"]- Air routes tagged "pages" to distinguish from other routes in API docsPull request type
Please check the type of change your PR introduces:
Pull request tasks
The following have been completed for this task:
examplesfolderChecklist
just testandjust qa, ensuring my code changes passes all existing testsDemo or screenshot
CLI banner showing new API docs URLs:

Other information
Behavior change: API docs and
/healthare now enabled by default. Users can disable withdocs_url=None,redoc_url=None, or override the health endpoint.