APIDevTools / swagger-cli

Swagger 2.0 and OpenAPI 3.0 command-line tool
https://apitools.dev/swagger-cli
MIT License
517 stars 68 forks source link

Undeclared parameters in server url should not validate #84

Open berzi opened 2 years ago

berzi commented 2 years ago

Given the following schema:

openapi: 3.1.0
info:
  title: Test
  version: 1.0.0

servers:
  - url: "https://example.com/{someParameter}/etc/{anotherParameter}"
    variables:
      someParameter:
        default: sometest123

paths: {}

Note how someParameter has a corresponding variable object, but anotherParameter doesn't. This probably should not be accepted, but swagger-cli validates the spec with no errors.