-
-
Notifications
You must be signed in to change notification settings - Fork 435
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
Error in pattern validation #409
Comments
We don't have that yet, but I do suggest passing an option through |
Can you please suggest any example for implementing same? |
I don't have a good example sorry. I'm thinking of this kind of options idea https://pkg.go.dev/github.com/getkin/[email protected]/openapi3#SchemaValidationOption but as a kin-openapi/openapi3/schema.go Line 581 in dc944ad
ctx maybe using a dedicated accessor function and from here decide whether to do kin-openapi/openapi3/schema.go Line 680 in dc944ad
Note that this last part is a solution to the data race uncovered in #371 |
Thanks for the explanation. |
By "loading swagger" you must mean to deserialize the openapi document? In which case no, I mean to add a flag that allows skipping the verification of correctness of the field "pattern" of all schemas in the document. |
Yes, i meant deserializing the openapi document. Adding a flag means do you want me to make changes for this as currently in schema validation we are checking if err = schema.compilePattern(); and here we are not checking if that flag exists. |
Has there been any update on this, we are attempting to parse 3rd party openapi schemas where we can't change the contents of the file and have run into a number of issues where we fail to load the file due to it failing regex validation even though we don't use the compiled pattern ourselves, just require the raw string |
While validating swagger file which has following pattern: ^[a-zA-Z0-9]{0,4096}$ gives error
Invalid components: cannot compile pattern "^[a-zA-Z0-9]{0,4096}$": error parsing regexp: invalid repeat count:
{0,4096}
Issue seems golang regexp has hardcoded 1000 max reapeat Count.
Do we have any option to disable pattern validation? or any other solution.
Thank you
The text was updated successfully, but these errors were encountered: