fastapi-jsonrpc
fastapi-jsonrpc copied to clipboard
Multiple OpenAPI examples
I understand that I can add examples to endpoints via
@api.method()
def endpoint(value1: str = Body(example='test'), value2: int = Body(example=3))
...
What to do if I want to add multiple examples as discussed in https://fastapi.tiangolo.com/tutorial/schema-extra-example/?h=examples#body-with-multiple-examples ? The obvious thing to do would be to use list the examples in the Body, as it is done in plain FastAPI, but that doesn't work. Perhaps the Entrypoint#method
method can accept an examples parameter (i.e. add it to the MethodRoute
class)?
Fastapi 0.99 version released and it's support openapi 3.1.0 which add native support for exampleS
https://fastapi.tiangolo.com/tutorial/schema-extra-example/#pydantic-and-fastapi-examples
I was try it out, but no effect. Need more time investment
@smagafurov