Skip to content
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

python error: ypeError: 'pmrequest' object is not subscriptable #19

Open
sgperlman opened this issue Mar 15, 2021 · 1 comment
Open

Comments

@sgperlman
Copy link

I'm trying to use swagman for the first time. Everything from requirements.txt has been installed (and confirmed to have been installed).

When I try to run against an exported postman collection, I'm getting the following error:

Traceback (most recent call last):
File "run.py", line 32, in
cli()
File "D:\Users\sgperlman\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 764, in call
return self.main(*args, **kwargs)
File "D:\Users\sgperlman\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "D:\Users\sgperlman\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "D:\Users\sgperlman\AppData\Roaming\Python\Python37\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "run.py", line 25, in cli
swagger_output = converter.convert(format)
File "D:\Users\sgperlman\OneDrive - US Electrical Services, Inc\My Documents\BitBucketRepos\swagman\swagman\convert.py", line 34, in convert
spec = self._mapper(spec, parser)
File "D:\Users\sgperlman\OneDrive - US Electrical Services, Inc\My Documents\BitBucketRepos\swagman\swagman\convert.py", line 50, in _mapper
spec.add_item(item)
File "D:\Users\sgperlman\OneDrive - US Electrical Services, Inc\My Documents\BitBucketRepos\swagman\swagman\spec.py", line 240, in add_item
operations = self.get_operations(item)
File "D:\Users\sgperlman\OneDrive - US Electrical Services, Inc\My Documents\BitBucketRepos\swagman\swagman\spec.py", line 158, in get_operations
camelizeKey = PostmanParser.camelize(item['request'].getPathNormalised())
TypeError: 'pmrequest' object is not subscriptable

@adamhospodka
Copy link

adamhospodka commented Aug 19, 2024

Same for me.

My setup:

  • MacBook Air M2 15", 2023
  • running Python 3.11.8
  • packages installed using Conda conda install {lib_name} -c conda-forge

My steps

  1. git clone
  2. install dependencies
  3. python run.py ...
Traceback (most recent call last):
  File "/Users/admin/git/swagman/run.py", line 32, in <module>
    cli()
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda_python_2/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda_python_2/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda_python_2/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda_python_2/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/git/swagman/run.py", line 25, in cli
    swagger_output = converter.convert(format)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/git/swagman/swagman/convert.py", line 34, in convert
    spec = self._mapper(spec, parser)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/git/swagman/swagman/convert.py", line 50, in _mapper
    spec.add_item(item)
  File "/Users/admin/git/swagman/swagman/spec.py", line 240, in add_item
    operations = self.get_operations(item)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/admin/git/swagman/swagman/spec.py", line 158, in get_operations
    camelizeKey = PostmanParser.camelize(item['request'].getPathNormalised())
                                         ~~~~^^^^^^^^^^^
TypeError: 'pmrequest' object is not subscriptable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants