paths: fix Operation request urljoin #85
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When adding operation
pathto the base_url, the use of the+operator can lead to doubling of/characters if the base_url ends with a/.Using urljoin should fix this. This is also a cleaner way to work with url paths.
This causes some minor issues for us when interacting with our rest api server where the doubled
/character is not matched correctly and results in 404 errors.Even though the doubled
/characters are defined in RFCs as something that should be simply skipped and don't effectively change the path, some http servers can be configured either way.An example of a reproducer is to use a schema that looks as follows:
vs.
Note that the difference is the final
/in the server url.For the first schema with the current code of openapi3 the request
api.call_listArtifacts()would call:Whereas with the fix the same request would call: