Closed michilu closed 3 years ago
I need this. It basically means I can't load any of my specs because they all use parameters like this.
I just push a PR #188 addressing the same issue, and see this PR afterward.
It seems to me that this PR does not handle parameter unicity when it merges parameters values from Path and Operation. And it doesn't seem it includes anything more than my PR.
PR #188 was merged today and address the same issue.
@michilu @nicolai-shape Does current master fix your issue ?
@lalmeras Yes, it works!
before 189321f:
$ poetry run http-prompt https://www.instagram.com --spec instagram.yaml
.venv/lib/python3.9/site-packages/http_prompt/cli.py:118: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
spec = yaml.load(content)
Traceback (most recent call last):
File ".venv/bin/http-prompt", line 33, in <module>
sys.exit(load_entry_point('http-prompt==1.0.0', 'console_scripts', 'http-prompt')())
File ".venv/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File ".venv/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File ".venv/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File ".venv/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File ".venv/lib/python3.9/site-packages/http_prompt/cli.py", line 128, in cli
context = Context(url, spec=spec)
File ".venv/lib/python3.9/site-packages/http_prompt/context/__init__.py", line 39, in __init__
params = info.get('parameters')
AttributeError: 'list' object has no attribute 'get'
now ac598fd:
$ poetry run http-prompt https://www.instagram.com --spec instagram.yaml
Version: 1.0.0
.venv/lib/python3.9/site-packages/http_prompt/cli.py:119: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
spec = yaml.load(content)
https://www.instagram.com>
Thanks!
The endpoint paths can have the parameters to directly below.
An example: https://github.com/apiaryio/swagger-zoo/blob/aa9118ac8db87594fb9ceb4e5c7ad0bb55a7a2f3/fixtures/examples/swagger/instagram.yaml#L215-L219