-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Is integer to number a breaking change for format int64? #4312
Comments
@sensiblewood-ozone the original was an error, and there was an incredibly long discussion about it which I can dig up if you want. If JSON Schema did allow that, then applying the schema Which is clearly not what you want. In practice, most people also include The current way is correct and will work as it was always intended to whether you use |
@handrews just for the record. In the wild, I am seeing tools adopt 3.0.4 and fail validation of a given API description where they passed at 3.0.3 due to this change. Regardless of the correctness or incorrectness of JSON Schema and the original specification, this is a change in behaviour that for me constitutes a breaking change. The horse has already bolted on this, as 3.0.4 is out in wild, so happy to close the ticket. |
@sensiblewood-ozone I don't understand the failure mode here. What is failing? |
To be a bit more clear, how is it possible for this to impact the validation of an OAD? The applicable type is not something you can validate. It has nothing to do with the The presence, absence, and value of the |
If tools want to flag nonsensical So in fact you do not want to change the value of |
I just thought to check the spec and this is explicitly addressed (although it's buried a bit so it's understandable to miss it):
The column showing formats and types is labeled "JSON Data Type" to try to make it clear that it's not a schema type. Perhaps a blog post and a page on the learn site are in order? |
What tool is doing this? Do you know what underlying JSON Schema evaluator it is using? We should report a ticket there as this behaviour sounds non-compliant. In addition, we can have this implementation add itself to the automated test suite in the json-schema organization, so we can see a report of which ways it is non-compliant (and also allow openapi tooling to select a better alternative). |
@handrews @karenetheridge thanks for all the clarifications. I agree based on the above that this does indeed constitute a patch not a breaking change. Looking at the specification this should be deterministic enough as a directive on
However, this gives wriggle room to error rather than ignore, due to MAY - if it was SHALL, it would be golden:
The Engineering team where I work have reported this being an issue in Postman. This is the error message they received on an existing
I need to dig into this in more detail by replicating the test teams set-up and provide significantly more information. Please bear with me on this. I'll report back here with the goods. |
Hmm... yeah that clause is actually redundant, which makes it misleading. JSON Schema guarantees that |
@handrews @karenetheridge turns out this was a false alarm. It was configuration of the tools themselves (and the tool wasn't Postman...) that cause the failure. Apologies for causing confusion and uncertainty on this.
Removing the second sentence in the guidance would be great in a future version. Closing this puppy down. Thanks again for all the guidance above. |
@sensiblewood-ozone glad to hear it was a configuration problem- and thanks for filing, it's a very confusing area and always better safe than sorry. |
I've noticed that the base type for the
format
valueint64
has gone frominteger
tonumber
: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.4.md?plain=1#L203I would assume that 3.0.4 is therefore not a patch release? For me this constitutes a breaking change.
Please can you clarify how this is classified as a patch rather than breaking change. Thank you.
The text was updated successfully, but these errors were encountered: