-
-
Notifications
You must be signed in to change notification settings - Fork 900
json-schema: Generated schema for Range numeric type breaks Draft 4 #6041
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
Comments
It's quite hard as we want to be as up to date as possible but it's really hard to support many versions. We definitely need to propose an update to |
I will report it and link these two together. I found the breaking change reference too between Draft 4 and 6. PS: I am OP, I accidentally submitted this issue with my work account. Edit: I am just going to try and open a PR for this specific issue of Draft 6 with Range numbers. I was browsing around the library for a bit and this issue was a bit demotivating. jsonrainbow/json-schema#699
|
@soyuka I was thinking, if the checker lib does not respond, would submitting a If anyone has the same issue, for my project I eventually override the generated schema via attributes or some decorator service. I have to have the schema checks in place all the time and I want to update. |
indeed I think we should add some backward compatibility |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
It looks like there are still some issues regarding schemas? I'm waiting for someone to come back with an update as 3.2.14 just came out |
API Platform version(s) affected: 3.2.7
Description
Generated JSON Schema for Range numbers changed from 3.2.6 to 3.2.7. The array copy previously was:
In 3.2.7 it is now:
They are both right in their own way. Because in JSON-Schema docs under range you can read:
There is also a Draft 4 specific interpretation:
The json-schema validator library used in API Platform only supports Draft 4, so any Range property now breaks schema assertions.
I am not sure if the team considers this a regression or not because I cannot find the reasoning for dropping Draft 4. Depending on this the fix can be different.
How to reproduce
In my case I have a
$position
property in my API Resource that has aSymfony\Component\Validator\Constraints\Positive
attribute. If you have an API test case that validates response json schema, you can see how it fails between 3.2.6 and 3.2.7.Possible Solution
The text was updated successfully, but these errors were encountered: