Skip to content

Is it possible to reference query parameter to enum defined in definitions ? #564

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

Closed
unoexperto opened this issue Feb 11, 2016 · 1 comment

Comments

@unoexperto
Copy link

Is it possible to reference query parameter to enum defined in definitions ? For example consider following example:

paths:
  /users/test:
    get:
      summary: Test endpoint
      parameters:
        - name: osType
          in: query
          description: Client's OS type.
          required: true
          type: string
          enum:
          - ios
          - android

then I define this

definitions:
  OsTypes:
    type: string
    enum:
    - ios
    - android

Can I reference it from endpoint to avoid defining allowed values of the enum in every endpoint that uses it ?

I tried

schema:
  $ref: '#/definitions/OsTypes'

Thanks!

@webron
Copy link
Member

webron commented Feb 11, 2016

There's currently no way to reference definitions that are not body parameters. We're definitely considering changing that in a future version, which is covered by #301.

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