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

openapi-types: A number is also allowed for a server variable value #901

Merged
merged 1 commit into from
May 8, 2024

Conversation

melroy89
Copy link
Contributor

@melroy89 melroy89 commented Mar 19, 2024

Currently, you only accept a string as a value default value type, but a number is also allowed (eg. for a port number) in OpenAPI.

Numbers are also an accepted type here! Example use-case:

        servers: [
          {
            url: 'http://localhost:{port}/{basePath}',
            description: 'Development server',
            variables: {
              port: {
                default: 3001
              },
              basePath: {
                default: 'api/v1'
              }
            }
          }
  • I only have 1 commit.
  • My commit is prefixed with the relevant package (e.g. express-openapi: fixing something) Note: You can use the bin/commit script to automate this.
  • I have added tests.
  • I'm using the latest code from the master branch and there are no conflicts on my branch.
  • I have added a suffix to my commit message that will close any existing issue my PR addresses (e.g. openapi-jsonschema-parameters: Adding examples to the validation keywords (fixes #455)).
  • My tests pass locally.
  • I have run linting against my code.

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 this pull request may close these issues.

None yet

2 participants