spectral icon indicating copy to clipboard operation
spectral copied to clipboard

Spectral Schema checking issue with property name "type" is used in a schema example

Open savage-alex opened this issue 2 years ago • 0 comments

Given a response body schema that returns an array of items and the item contains a property called type and it contains another property called default that is type boolean When a schema level example is provided Spectral gives an error incorrectly

image

In the example you can see where the type was set to boolean (its just a property and a value) there was no error when type has any other value the default boolean property is errored.

This doesnt happen on in-lined examples. Only schema level examples.

Example OpenAPI here that shows the issue: https://app.swaggerhub.com/apis/AdvancedComputerSoft/broken-example-default-property/1.0.0

savage-alex avatar Jan 24 '23 13:01 savage-alex