Skip to content
Discussion options

You must be logged in to vote

Currently, it is a known missing feature within the Swagger UI (See: #1083 ) and the generation of the example cannot be automatically done by Swagger UI, however it is possible to provide a manual example, which would mean that you have to make an example to be displayed.

Link to the Relevant Issue Solution from #1083

Link to Another Solution from #86

The Example Shows you that you need to provide a manual example like so:

Create A Class that holds the Union of any of the three Classes:

class parent(BaseModel):
    id: str


class child1(parent):
    code: str
    user: Dict[str, str]


class child2(parent):
    error: Any


class child3(parent):
    code: str
    user_data: Dict[str, str]…

Replies: 11 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Kludex
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem question-migrate
3 participants
Converted from issue

This discussion was converted from issue #1947 on February 28, 2023 00:52.