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

Collects parameters directly below of the endpoint paths #154

Closed
wants to merge 2 commits into from

Conversation

michilu
Copy link

@michilu michilu commented May 18, 2019

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

paths:
  /users/{user-id}:
    parameters:
      - $ref: '#/parameters/user-id'
    get:
      ...

@michilu michilu force-pushed the feature/collects-parameters branch from 56e52db to 3ec92e0 Compare May 18, 2019 01:28
@nicolai-shape
Copy link

I need this. It basically means I can't load any of my specs because they all use parameters like this.

@lalmeras
Copy link
Contributor

lalmeras commented Feb 7, 2021

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.

@lalmeras
Copy link
Contributor

lalmeras commented Feb 7, 2021

PR #188 was merged today and address the same issue.

@michilu @nicolai-shape Does current master fix your issue ?

@michilu
Copy link
Author

michilu commented Feb 7, 2021

@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!

@michilu michilu closed this Feb 7, 2021
@michilu michilu deleted the feature/collects-parameters branch February 7, 2021 22:24
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

Successfully merging this pull request may close these issues.

None yet

3 participants