-
Notifications
You must be signed in to change notification settings - Fork 15
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
swagger-brake not reporting violation in breaking changes | MIN/MAX validation | POST object mandatory field validation #42
Comments
@madhur2928 thanks for reporting. Certainly the min/max validation is something missing from the current ruleset, however the second use-case should fail. Anyway, I'll look into both of the cases and get back to you soon. |
…iveMinimum attributes for integer parameter types
Fixed on master, new version will be released soon. |
thanks @galovics for fixing the issue. I took a checkout from master and tried replicating the issue. But still facing couple of issues.
attached the json files |
@madhur2928 let me take another look then at request body validations. Perhaps I missed it. :) |
@madhur2928 in fact request body validation was completely missing, so I'm doing the implementation. Also, please bear in mind that I intentionally did not implement the regex constraint validation. In my opinion it's way too complicated to implement something like that. The only thing swagger-brake could easily verify if the pattern has changed, but IMHO that's going to result in many false positives. Somehow it should rather detect if the new regex is equal in terms of semantics or an expansion of the original regex. If you have any ideas, feel free to share. |
@madhur2928 give it a try from latest master, let's see how it goes. |
I am facing couple of issues where swagger-brake is not reporting violation in breaking changes
Old Contract
{
"name": "orderId",
"in": "path",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "integer",
"maximum": 10,
"minimum": 1,
"format": "int64"
},
New Contract
{
"name": "orderId",
"in": "path",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "integer",
"maximum": 5,
"minimum": 3,
"format": "int64"
},
Output
Loading old API from swagger-old.json
Loading new API from swagger-new.json
Successfully loaded APIs
Starting the check for breaking API changes
Check is finished
No breaking API changes detecte
Old Contract:
"Pet": {
"type": "object",
"required": [
"photoUrls"
],
New Contract:
"Pet": {
"type": "object",
"required": [
"photoUrls",
"name"
],
Output
Loading old API from swagger-old.json
Loading new API from swagger-new.json
Successfully loaded APIs
Starting the check for breaking API changes
Check is finished
No breaking API changes detected
Attached both old and new swagger json files
swagger.zip
Please look into it and let me know in case any further details are needed.
Thanks,
Madhur
The text was updated successfully, but these errors were encountered: