-
-
Notifications
You must be signed in to change notification settings - Fork 137
Mess with paths #93
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
Comments
I find that it works if you leave out the type. So instead of |
@GlennS I'm confused a little - can't find any type notation in my paths definitions. Could you please explain what do you mean by that? |
I meant in the Flask route itself. So, instead of the usual: Use: |
I've a similar issue with Django, which up until 2.0 only supported regex-style URL templates. Since 2.0, it supports and recommends URLs closer to what flask uses, albeit with optional type annotations (or path converters in Django lingo). I have worked around this locally by hacking together something that will find and extract the regex used to resolve the provided path, then convert that regex to the template string style that openapi-core expects. However, this is hacky, relies on Django internals that are subject to change, and tightly couples how URLs are defined in my I think it would be a good idea if openapi-core converted each URL template from the spec to a basic regex and stored these in |
As an aside, this sounds like a dupe of #35 and should probably be deprecated in favour of that. |
@stephenfin yup. Closing it.Duplicate of #35. |
I like that idea as we can couple the schema properties with the parameter place holder: etc. |
Hmm, depends on how you want to do the testing. I personally have a plethora of tests already in place and I was simply using the |
If you have url pattern in flask, you'll never get your paths validated.
Will always get an error
Because flask url pattern syntax and openapi pattern syntax do not match.
An error hides here https://github.com/p1c2u/openapi-core/blob/master/openapi_core/validation/request/validators.py#L24
The text was updated successfully, but these errors were encountered: