Skip to content

Support default values in query params #23

Description

@AustinGil

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions