Skip to content

2.0.18 regression wrong error message when validating the server url #1329

@jmini

Description

@jmini

This example spec:

openapi: 3.0.0
info:
  title: Issue with server
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
- url: http://{server}.swagger.io:{port}/v2
  description: petstore server
  variables:
    server:
      default: petstore
      enum:
      - petstore
      - qa-petstore
      - dev-petstore
    port:
      default: "80"
      enum:
      - "80"
      - "8080"
- url: https://localhost:8080/{version}
  description: The local server
  variables:
    version:
      default: v2
      enum:
      - v1
      - v2
paths:
  /ping:
    get:
      operationId: pingGet
      responses:
        '201':
          description: OK

With version 2.0.18 this is now reporting errors:

attribute .servers. invalid url : http://{server}.swagger.io:{port}/v2
attribute .servers. invalid url : https://localhost:8080/{version}

With 2.0.17 this was not the case.


This can also be reproduced with the example provided in the official spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#server-object-example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions