I have tried to convert the JSON example you provided me with into YAML, the definition doesn’t appear to be reporting any errors with the format of the spectral.yaml file within stoplight studio, but it does not appear to be working as I expected.
I am trying to achieve the following rule:
If the endpoint does not contain an optional query parameter called society then report an error.
This is the configuration I currently have within the spectral.yaml file
description: Ensures that the service contains society as an optional query parameter
message: The service must contain society as an optional query parameter
given: "$.paths.*.*.parameters.[?(@.in === \"query\")]"
Can you or anyone else help?
Thanks in advance for your help