-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema has the example property, but no exampleRef #564
Comments
Hi @woodgoblin , thanks for opening this issue. I don't believe OAS supports references to the Are you suggesting some form of pre-processing that would in-line an example from |
Hi @MikeEdgar, if it's the only possible way to solve it then yes. |
We discussed this issue on today's MP OpenAPI meetup call. @woodgoblin , have you looked at the possibility of using an example attached to the use of the schema? That might be via the |
Example references are much clearer and much more consistent ways to not desync examples and schemas in generated OpenAPI.
However, if I need to have 3 slightly different examples in a single array in a HUGE DTO, I need to override all of the request/response object JSON because the @Schema property can not contain nor the @ExampleObject, nor the exampleRef, which would allow us to point to the example reference which is checked against its schema class in OAS model filter.
Allowing a DTO field to have a free-form JSON example that 100% would contradict the schema at some point right in the java code, but not allowing the same field to draw from the example references pool OAS model has is pure malice.
To further explain what I mean, I'll have a following example:
Permitted:
Not permitted:
The text was updated successfully, but these errors were encountered: