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

Support default values in query params #23

Open
AustinGil opened this issue Apr 23, 2021 · 1 comment
Open

Support default values in query params #23

AustinGil opened this issue Apr 23, 2021 · 1 comment

Comments

@AustinGil
Copy link

The Swagger specification points out that you can set default values for parameters (https://swagger.io/docs/specification/describing-parameters/#default).

I tried adding some to my route definition, but it doesn't seem to do anything. Here's what mine looks like:

openapi.validPath({
    // ...
    parameters: [
      {
        in: 'query',
        name: 'perPage',
        schema: { type: 'integer', default: 24 },
      },
    ],
    // ...
})

Does the library support default values?

@wesleytodd
Copy link
Owner

I don't think it does support them, but I would accept a PR for that for sure.

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