Repository navigation
|
I have a REST endpoint that returns different Media Types according to the Accept Header. How can I specify different examples for every Media Type? I do have a How can I annotate this? There's no possibility to have several |
Answered by
MikeEdgar
Jan 27, 2025
Replies: 1 comment 2 replies
|
@cristalp you can have multiple content entries, one for each Media Type. @RequestBody(
content = {
@Content(mediaType = "application/json", schema = @Schema(/* JSON schema or $ref */), examples = { /* JSON examples */ }),
@Content(mediaType = "text/csv", schema = @Schema(/* CSV schema or $ref */), examples = { /* CSV examples */ })
}
) |
2 replies
Answer selected by
cristalp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cristalp you can have multiple content entries, one for each Media Type.