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

Bug: OpenAPI schemas give wrong completion when the root of the API is a path relative to the domain #197

Open
psacawa opened this issue Jun 14, 2021 · 0 comments · May be fixed by #216
Open

Comments

@psacawa
Copy link

psacawa commented Jun 14, 2021

I have an example API, hosts at https://statsapi.web.nhl.com/api/v1, which has its root at the path/api/v1 relative to the domain. I also have the corresponding (schema)[https://github.com/erunion/sport-api-specifications/blob/master/nhl/nhl.yaml]. However, when I try:

http-prompt https://statsapi.web.nhl.com/api/v1 --spec nhl.yaml

I find that the program displays completions as if there were no path given in the API root URL. So for instance, typing cd / givens the completion options from the schemas paths (divisions, etc..) rather than the actual root relative to the domain /api, as it should.

http-prompt 2.1.0
python 3.9

aVolpe added a commit to aVolpe/http-prompt that referenced this issue Apr 24, 2023
In openapi 3 the 'schemes' and 'basePath' were replaced with a single
property called 'servers', in this property we introduce the avaiable
servers with the full path, for example:

```yaml
servers:
  - url: https://statsapi.web.nhl.com/api/v1
 ```

With this change, a flag is added in the parsing of the context
`is_open_api` that can be used to check for the new properties available
in open api 3.

fixes httpie#197

Signed-off-by: Arturo Volpe <[email protected]>
aVolpe added a commit to aVolpe/http-prompt that referenced this issue Apr 24, 2023
In openapi 3 the 'schemes' and 'basePath' were replaced with a single
property called 'servers', in this property we introduce the available
servers with the full path, for example:

```yaml
servers:
  - url: https://statsapi.web.nhl.com/api/v1
 ```

With this change, a flag is added in the parsing of the context
`is_open_api` that can be used to check for the new properties available
in open api 3.

fixes httpie#197

Signed-off-by: Arturo Volpe <[email protected]>
@aVolpe aVolpe linked a pull request Apr 24, 2023 that will close this issue
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 a pull request may close this issue.

1 participant