Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: u8sand/PySwaggerClient
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2
Choose a base ref
...
head repository: u8sand/PySwaggerClient
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jun 18, 2020

  1. Fixed paths without slashes

    u8sand committed Jun 18, 2020
    Copy the full SHA
    55b847f View commit details
Showing with 8 additions and 2 deletions.
  1. +7 −1 pyswaggerclient/fetch.py
  2. +1 −1 setup.py
8 changes: 7 additions & 1 deletion pyswaggerclient/fetch.py
Original file line number Diff line number Diff line change
@@ -58,8 +58,14 @@ def repair_spec(spec_v2):
# Update the spec
spec_v2['paths'][path][method]['operationId'] = op_id

# add leading slash on paths if not present
spec_v2['paths'] = {
('/' + path) if not path.startswith('/') else path: op
for path, op in spec_v2['paths'].items()
}

if spec_v2.get('basePath') is not None:
spec_v2['basePath'] = '/' if spec_v2['basePath'] == '/' else spec_v2['basePath'].rstrip('/')
spec_v2['basePath'] = spec_v2['basePath'].rstrip('/')

return spec_v2

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

setup(
name='pyswaggerclient',
version='1.0',
version='1.3',
packages=['pyswaggerclient'],
license='Apache-2.0',
long_description=open('README.md', 'r').read(),