Closed yay9096 closed 1 year ago
@yay9096 what server/runtime are you using? Can you also share the fields that the @Schema
annotations are used with?
@MikeEdgar Thank you for reply, runtime is java 1.8, server is Mac 12.2.1(Intel core), microprofile-openapi.version is 1.0, fields are created_at, started_at and last_updated_at, our api output date-time format is YYYY-MM-DDTHH:MM:SSZ, so we want to give user a example for the date-time response, so we use "example" in @Schema to define it, however, when we use this definition, the example will be {}, if we do not use example in @Schema, it will display an example "YYYY-MM-DDTHH:MM:SS.MSSZ", but it is not match with our expectation.
@JsonbProperty("created_at")
@Schema(name = "created_at", format = "date-time")
private String createdAt;
@JsonbProperty("last_updated_at")
@Schema(name = "last_updated_at", format = "date-time", example = "2018-03-20T09:12:28Z")
private String lastUpdatedAt;
@JsonbProperty("started_at")
@Schema(name = "started_at", format = "string", example = "2018-03-20T09:12:28Z")
private String startedAt;
@yay9096, what MicroProfile OpenAPI implementation are you using? E.g. Quarkus, Open Liberty, Payara, etc. This may be an implementation bug rather than an issue in the specification itself.
@MikeEdgar We use Open Liberty implementation, and check 2.0.1 version still has the issue. import org.eclipse.microprofile.openapi.annotations.media.Schema;
@yay9096 Thanks for providing the info! Can you open an issue on Open Liberty and we will look into it?
@Emily-Jiang Thank you, I have filed https://github.com/OpenLiberty/open-liberty/issues/21737 for the issue
Closing this as it's been handled as an implementation issue mentioned.
1.8
Mac 12.2.1, but other env same issue [Step] We want to display example for date-time field as this format "YYYY-MM-DDTHH:MM:SSZ", e.g, we defined as bellow: @Schema(name = "created_at", format = "date-time") @Schema(name = "last_updated_at", format = "date-time", example = "2018-03-20T09:12:28Z") @Schema(name = "started_at", format = "string", example = "2018-03-20T09:12:28Z")
[Current] After build, check the openapi/ui, Schema display OrderedMap error
And Example value will display as bellow: for the first item did not use example, it will display "YYYY-MM-DDTHH:MM:SS.MSSZ", and for others example, it will display {}
[Expectation]
![image](https://user-images.githubusercontent.com/78241853/177963910-79f69bf6-fb56-4883-ac6a-2f95ef169518.png)