-
Notifications
You must be signed in to change notification settings - Fork 91
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
fix: use more accurate formats for byte, short, and char types #2128
Conversation
Signed-off-by: Michael Edgar <[email protected]>
@dhoffer, FYI. Let me know if this change matches your expectations. |
Hi @MikeEdgar It still seems a little off: @JsonView(Views.Abridged.class)
@Schema(description = "Relative velocity to skin line.", example = "1")
private short h29; Results in: "h29" : {
"type" : "integer",
"description" : "Relative velocity to skin line.",
"example" : 1
}, I think it should be: "h29" : {
"type" : "integer",
"format" : "int16",
"description" : "Relative velocity to skin line.",
"example" : 1
}, And @JsonView(Views.Abridged.class)
@Schema(description = "Computed object length based upon HRR profile, in meters.", minimum = "0", maximum = "100", example="22")
private byte h30; Results with: "h30" : {
"type" : "string",
"format" : "byte",
"description" : "Computed object length based upon HRR profile, in meters.",
"maximum" : 100,
"minimum" : 0,
"example" : "22"
}, And we think it should be: "h30" : {
"type" : "integer",
"format" : "int8",
"description" : "Computed object length based upon HRR profile, in meters.",
"maximum" : 100,
"minimum" : 0,
"example" : "22"
}, byte, short, int, long are all integers with different size specified in the format. I'm using these dependencies that I built locally. <dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-open-api-core</artifactId>
<version>4.0.6-SNAPSHOT</version>
</dependency>
dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-open-api-jaxrs</artifactId>
<version>4.0.6-SNAPSHOT</version>
</dependency> |
@dhoffer, the snippets you gave as your expected results are what I see locally. Did you build |
Hi @MikeEdgar my bad, yes I was on main. I guess I thought this was already merged to main but I see its not. I don't seem to have access to pull down your PR branch. Given your reply, I say this is ready for a merge. I will test as soon as I have access. |
Quality Gate passedIssues Measures |
Hi @MikeEdgar I have confirmed the 4.0.6-SNAPSHOT code fixes this and the other related issue. How soon could we get a release? |
byte
:format: int8
short
:format: int16
char
:format: char
See the format registry for reference: https://spec.openapis.org/registry/format/
Fixes #2124
Fixes #2126