Description
When using PathParams containing a '/' character, the Python client does not encode the '/'. As a result, the / is interpreted as a path separator rather than a parameter value. PathSegments must encode the / character for proper transfer of information. e.g. 'my/string' should be encoded to 'my%2Fstring' for correct transmission of a PathParam argument. Path separators must only be used between path segments.
Swagger-codegen version
Not a regression, this is broken on the master HEAD.
Swagger declaration file content or url
Not a problem with the definition, problem with the template code.
Command line used for generation
python client code gen, vanilla
Steps to reproduce
- create a client using a path parameter
- attempt call the client using a string PathParam argument with a '/' in it.
- Notice that an error is returned from the server.
Related issues
Not reported.
Suggest a Fix
the ApiClient uses the urllib "quote" function which by default sets the '/' as a "safe" character, e.g. quote('my/string') -> 'my/string'.
However, setting the safe chars default arg to indicate no chars are safe yields the desired result: quote('my/string', safe='') ->'my%2Fstring'
Description
When using PathParams containing a '/' character, the Python client does not encode the '/'. As a result, the / is interpreted as a path separator rather than a parameter value. PathSegments must encode the / character for proper transfer of information. e.g. 'my/string' should be encoded to 'my%2Fstring' for correct transmission of a PathParam argument. Path separators must only be used between path segments.
Swagger-codegen version
Not a regression, this is broken on the master HEAD.
Swagger declaration file content or url
Not a problem with the definition, problem with the template code.
Command line used for generation
python client code gen, vanilla
Steps to reproduce
Related issues
Not reported.
Suggest a Fix
the ApiClient uses the urllib "quote" function which by default sets the '/' as a "safe" character, e.g.
quote('my/string')-> 'my/string'.However, setting the safe chars default arg to indicate no chars are safe yields the desired result:
quote('my/string', safe='')->'my%2Fstring'