apisyouwonthate / style-guide

A shared and somewhat opinionated style guide for everyone to enjoy.
141 stars 20 forks source link

Query Parameter example exists rule #10

Closed savage-alex closed 4 years ago

savage-alex commented 4 years ago

Hi,

I have the following rule: adv-query-parameters-example-exists: description: All query parameters SHOULD have an example. severity: error message: 'All query parameters SHOULD have an example.' given: "$..parameters[?(@.in == 'query')]" then: field: example function: truthy image

Which works fine on all but examples that are of type Boolean and value of False. Any ideas?

philsturgeon commented 4 years ago

@savage-alex great point!

@p0lip has just added a defined core function so you can use that when we get v5.5.1 tagged.

savage-alex commented 4 years ago

Kudos for the super fast fix!

philsturgeon commented 4 years ago

Spectral v5.6.0 has been released and contains this defined core function.