Hi all, I'm struggling to get named examples for a request body to work.
The OpenAPI spec here should support it:
https://spec.openapis.org/oas/v3.1.0#example-object
Redocly has an example here for Request examples:
https://redocly.com/docs/openapi-visual-reference/example#request-examples
I was able to take some of the code from the documentation on Customizing the Operation Class to sort-of get the behavior I want:
https://docs.litestar.dev/latest/usage/openapi/schema_generation.html#customizing-operation-class
FastAPI had a similar issue and appears to have fixed it here:
https://fastapi.tiangolo.com/tutorial/schema-extra-example/#openapi-examples-in-the-docs-ui
Note the CustomOperation where I'm sticking the examples in manually. Running this gets me what I want, but it feels like I'm doing it in a way that is way too janky.
Thanks in advance to anyone who reaches out. I've banged my head on my desk with this issue for about 2 days now.
The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.