Closed madhur2928 closed 3 years ago
@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.
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. Both min/max validation and post object mandatory field validation is working fine now.
But still facing couple of issues.
attached the json files swagger.zip
@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