kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
895 stars 237 forks source link

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

Closed melroy89 closed 6 months ago

melroy89 commented 8 months ago

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'
              }
            }
          }