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

how to set the different parameter to a url? #3214

Closed
codepandy opened this issue Jun 9, 2017 · 4 comments
Closed

how to set the different parameter to a url? #3214

codepandy opened this issue Jun 9, 2017 · 4 comments

Comments

@codepandy
Copy link

  • swagger-ui version the latest
    the below url is a example:
  /store/order?name=abe
  /store/order?Id=12

the two urls' http type are get.
the two parameters can't be used together.

@webron
Copy link
Contributor

webron commented Jun 9, 2017

The spec doesn't allow you to define mutually exclusive parameters. You'd have to define them both and add documentation to that effect.

@webron webron closed this as completed Jun 9, 2017
@codepandy
Copy link
Author

codepandy commented Jun 9, 2017

@webron
If I define them both,there will be a error.

duplicated mapping key.

whether the parameter can be grouped.

@webron
Copy link
Contributor

webron commented Jun 9, 2017

The spec doesn't allow you to define query parameters as part of the path.

@hkosova
Copy link
Contributor

hkosova commented Jun 9, 2017

@codepandy: what @webron is trying to say is that you need a single path with both parameters:

paths:
  /store/order:
    description: The `name` and `Id` parameters are mutually exclusive.
    parameters:
      - in: query
        name: name
        type: string
      - in: query
        name: Id
        type: integer

There's a proposal to add support for parameter dependencies in the OpenAPI Specification in OAI/OpenAPI-Specification/issues/256, you can follow that for updates.

@lock lock bot locked and limited conversation to collaborators Jul 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants