-
-
Notifications
You must be signed in to change notification settings - Fork 511
Open
Labels
Bug 🐛This is something that is not working as expectedThis is something that is not working as expected
Description
Description
Having an endpoint:
@post(
"/",
status_code=status.HTTP_201_CREATED,
)
async def post_length_norms(
data: Annotated[
SomeType,
Body(
examples=[
Example(
id="baseRequest",
summary="random base request",
value=generate_random_body(1),
),
Example(
id="anotherRequest",
summary="second base request",
value=generate_random_body(2),
),
],
),
],
) -> SomeResponse:
...
Does not show any example bodies. The examples seem to end up wrongly in the openapi.yaml file:
...
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SomeResponse'
SomeResponse:
examples:
- some_response:
...
- some_response:
...
properties:
...
type: object
...
weirdly enough, I get 2x some_response instead of the id/summary, so things don't seem to render properly
Litestar Version
2.19.0
Platform
- Linux
- Mac
- Windows
- Other (Please specify in the description above)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐛This is something that is not working as expectedThis is something that is not working as expected