Document an API with an OpenAPI specification
Usage description
Extract an OpenAPI specification from the server routes and write examples.
Prompt text
Extract an OpenAPI 3.1 specification for the {{project}} API ({{stack}}) from the route code.
- For each route: the description, parameters, request body, responses and status codes, and authentication.
- Realistic request and response examples inferred from the code.
- Validate the file with a validator and show me the result.
{{extra}}Required inputs
The route code.
Expected outputs
An openapi.yaml file and the validation result.
Suitable tools
Practical example
stack = “FastAPI”.
We do not claim this prompt was tested on a particular model; results vary with the model and context, so always review the output.
