We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
first of all, thanks for all your efforts on this project!
I noticed that string validation for the uuid format is a bit too lax and passes on obviously non-uuid strings:
Given the following OpenAPI file
#schema.yml openapi: 3.0.3 paths: /foo: get: parameters: - name: id in: query schema: type: string format: uuid
I would expect the following code to fail
require 'openapi_parser' require 'yaml' root = OpenAPIParser.parse(YAML.load_file('schema.yml')) request_operation = root.request_operation(:get, '/foo') request_operation.validate_request_parameter({"id" => "204730df-d3f5-364b-9aeb-d1372aba0d35-foobar"}, {}) request_operation.validate_request_parameter({"id" => "foobar-204730df-d3f5-364b-9aeb-d1372aba0d35"}, {})
But it runs without error. I guess your regex matches as long as it finds a valid uuid substring.
Any chance of tightening this up? Would be willing to help if you think it a good idea.
The text was updated successfully, but these errors were encountered:
Yes, we should be fix this problem! This is bug because we check UUID format and this string pass checking 🤔 https://github.com/ota42y/openapi_parser/blob/master/lib/openapi_parser/schema_validator/string_validator.rb#L69
Sorry, something went wrong.
@ota42y #149 should fix this problem. Is anything else blocking this or could we move forward?
Successfully merging a pull request may close this issue.
Hi,
first of all, thanks for all your efforts on this project!
I noticed that string validation for the uuid format is a bit too lax and passes on obviously non-uuid strings:
Given the following OpenAPI file
I would expect the following code to fail
But it runs without error.
I guess your regex matches as long as it finds a valid uuid substring.
Any chance of tightening this up? Would be willing to help if you think it a good idea.
The text was updated successfully, but these errors were encountered: