You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The OAS schema generated using SchemaGenerator interprets the whole portion within {} eg. 'user_id:int' as the required path parameter variable name, which then requires the parameter name in OAS to be user_id:int instead of just user_id.
I think the convertor is great in that a GET request to /users/foo will result in 404: NOT FOUND. Of course, another option is to have a try-except clause to handle non-integer values within the method... but I was wondering what the community thinks about this and if this even should be supported by the SchemaGenerator.
The text was updated successfully, but these errors were encountered:
As a first pass at resolving this we should just do the simple thing and strip any :<specifier> portion from the string. Would gratefully accept a pull request for that.
A second pass could be to also make sure that we're generating the correct type description in OpenAPI.
When specifying a convertor type for a path parameter like so:
The OAS schema generated using
SchemaGenerator
interprets the whole portion within{}
eg.'user_id:int'
as the required path parameter variable name, which then requires the parameter name in OAS to beuser_id:int
instead of justuser_id
.I think the convertor is great in that a GET request to
/users/foo
will result in404: NOT FOUND
. Of course, another option is to have atry-except
clause to handle non-integer values within the method... but I was wondering what the community thinks about this and if this even should be supported by theSchemaGenerator
.The text was updated successfully, but these errors were encountered: