Closed mzielinski closed 7 months ago
Describe the feature
It would be good to have possibility to define example response for each of OpenApiResponse
responses = [ OpenApiResponse( status = "200", description = "SUCCESS", content = [OpenApiContent(Response::class)] ), OpenApiResponse( status = "500", description = "UNEXPECTED_ERROR", content = [OpenApiContent(Response::class)] ), OpenApiResponse( status = "503", description = "SERVICE_UNAVAILABLE", content = [OpenApiContent(Response::class)] ) ],
I have such content in OpenAPI specification:
It would be nice to have possibly to define examples and finally have such output
To achieve that, we need to inject example into content part
example
content
"500": { "description": "UNEXPECTED_ERROR", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Response" }, "example": { "statusCode": "500", "subStatusCode:": "ERROR-CODE-500-1", "statusMessage": "Unexpected Error" } } } },
Yes, I already had a conversation about this particular feature on our Discord server today, and it was reported an hour ago in #212 :) It should be implemented by the end of this week.
Describe the feature
It would be good to have possibility to define example response for each of OpenApiResponse
I have such content in OpenAPI specification:
It would be nice to have possibly to define examples and finally have such output
To achieve that, we need to inject
example
intocontent
part