APIDevTools / swagger-cli

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

False positive: #/servers/0/variables/someParameter must NOT have unevaluated properties #83

Open berzi opened 1 year ago

berzi commented 1 year ago

Given the following spec:

openapi: 3.1.0
info:
  title: Test
  version: 1.0.0

servers:
  - url: "https://example.com/{someParameter}"
    variables:
      someParameter:
        default: sometest123
        description: Some description!

paths: {}

swagger-cli reports:

Swagger schema validation failed.

/servers/0/variables/someParameter must NOT have unevaluated properties

The error goes away if I remove the description property.

The error message is rather arcane (what is an unevaluated property? What does it mean for a property to be "unevaluated"? What can I do to fix this?), but besides that, the error is, as far as I can tell, a false positive, because the specification for openapi 3.1.0 allows this schema and the description property.

This only occurs for 3.1.0: if I change the first line to openapi: 3.0.3 the schema validates correctly. Note that the description property is allowed on both the mentioned versions.