Home Posts Projects

FastAPI exmaples not showing up in swagger docs of OpenAPI spec

12-06-2025

  • https://fastapi.tiangolo.com/tutorial/schema-extra-example/#body-with-multiple-examples
  • for Body attribute, with multiple exmaples
    • use openapi_examples
  • for Query attribute, with one example
    • use example

Related

28-10-2024

FastAPI to include servers when generating OpenAPI spec

04-05-2022

Add example for enum in FastAPI query parameters

© 2026 Luke Miloszewski

Email Address GitHub Twitter