fastapi-jsonrpc icon indicating copy to clipboard operation
fastapi-jsonrpc copied to clipboard

How to show multiple samples in request body of swagger doc?

Open foreso-GitHub opened this issue 1 year ago • 0 comments
trafficstars

I tried to write swagger doc with mulitple samples in request body but failed.

Here is my code:

@api_v1.method()
def echo(
    data: str = Body(..., examples=['123', '456']),
) -> str:
    return data

And here is what swagger ui doc shows.

image

What I want is a dropdown combobox which include multiple samples.

image

Does fastapi-jsonrpc support multiple samples?

foreso-GitHub avatar Mar 05 '24 08:03 foreso-GitHub