-
-
Notifications
You must be signed in to change notification settings - Fork 907
fix(jsonschema): keep integer and number properties draft 4 compliant #6098
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start, we also need to add that draft4 information to the https://github.com/api-platform/core/blob/main/src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php#L121
indeed, that way it'll continue to work with the current version of the json-schema validator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few more changes
amazing thanks! |
I am opening this PR as a starting point to close the issue linked above. From a quick conversation with @soyuka in Symfony Slack workspace I am introducing a top-level decorator that targets
integer
andnumber
properties that have range definition in them. The definition is set to Draft 4 of jsonschema since the assertion library the API Platform comes with does not recognize current Draft 6 defintion.I want to add tests but I am not sure what are the preferred tests by the team. There are no behat tests for jsonschema checks directly (they are indirectly assessed in openapi feature files). I thought to add a
KernelTestCase
since the schema will append the extra definitions based on Symfony assertions found in the property. Let me know, happy to add/squash more in this PR.