-
Notifications
You must be signed in to change notification settings - Fork 0
OpenAPI Documentation
Michael Pisman edited this page Aug 7, 2025
·
1 revision
As our API is built using FastAPI, we can use OpenAPI to document our API. OpenAPI is a specification for describing RESTful APIs. It allows us to describe the API in a human-readable format and generate documentation and client libraries automatically.
Once your API server is running, you can access the interactive OpenAPI documentation at:
-
Swagger UI:
http://localhost:9000/docs -
ReDoc:
http://localhost:9000/redoc
These interfaces provide:
- Complete API endpoint documentation
- Interactive request/response testing
- Schema definitions
- Authentication testing
- Self-updating documentation that stays in sync with your code
- Interactive documentation that allows testing endpoints directly
- Multiple format outputs (JSON, YAML, HTML)
You can generate client libraries for many programming languages using tools like:
- OpenAPI Generator - Supports 40+ languages
- openapi-typescript-codegen - Excellent for frontend TypeScript projects
OpenAPI specifications work with many development tools:
- Postman - Import OpenAPI specs for API testing
- Insomnia - Alternative API testing tool
- Code editors - Many support OpenAPI for autocompletion and validation
You can download the OpenAPI schema in JSON format using:
unipoll-api get-openapiOr access it directly at: http://localhost:9000/openapi.json
This JSON file can be imported into various tools or used to generate client libraries for your applications.