swagger-cli icon indicating copy to clipboard operation
swagger-cli copied to clipboard

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

Open berzi opened this issue 3 years ago • 0 comments

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.

berzi avatar Oct 13 '22 13:10 berzi