We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
..unless Im missing something.
I want to configure the example that will be present in an array. As in the case below I want the example to be 'MONDAY':
components: schemas: Pojo: properties: weekDays: type: array description: |- Restriction week days. Values - [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY] items: type: string example: "MONDAY"
To achieve this I try:
@JsonbProperty("weekDays") @Schema(name="weekDays", type = SchemaType.ARRAY, implementation = String.class, example = "MONDAY", description="Restriction week days.\nValues - [MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY]") private Set<DayOfWeek> weekDays = Collections.emptySet();
But the example is not at the item level as I need it, but at the weekDays property level.
How can I generate an items example?
The text was updated successfully, but these errors were encountered:
Merge pull request eclipse#445 from phillip-kruger/master
ca9bde9
Maven plugin for SmallRye Open API
Something like this should work.
@Schema(name = "DayOfWeek", example = "MONDAY") enum DayOfWeek { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY } @Schema(name = "Pojo") class Pojo { Set<DayOfWeek> weekDays; }
When using the SmallRye OpenAPI implementation the resulting schemas look like this:
"components" : { "schemas" : { "DayOfWeek" : { "enum" : [ "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY" ], "type" : "string", "example" : "MONDAY" }, "Pojo" : { "type" : "object", "properties" : { "weekDays" : { "uniqueItems" : true, "type" : "array", "items" : { "$ref" : "#/components/schemas/DayOfWeek" } } } } } }
Sorry, something went wrong.
No branches or pull requests
..unless Im missing something.
I want to configure the example that will be present in an array.
As in the case below I want the example to be 'MONDAY':
To achieve this I try:
But the example is not at the item level as I need it, but at the weekDays property level.
How can I generate an items example?
The text was updated successfully, but these errors were encountered: