@stoplight/spectral: check the file type of the given OpenAPI spec file: is it .yaml or .json

I’ve recently started using this tool.
Explored search results, trying to find Spectral rules to check the file type of the given OpenAPI specification file: is it .yaml or .json.
The reason is, we are currently trying to establish some sort of consistency when receiving spec files from the API developers. Thanks!
p.s.:
Having such a Spectral rule would be easier to have its results to be included in the report file & resulting pipeline artifact.

Probably, if no such Spectral rules, one of the last resorts could be writing some bash or python.

Little more information required but in general this is un-related to apigee but more of a stoplight which in this case you will need to follow below to setup custom rules according to your company api guidelines.

https://meta.stoplight.io/docs/spectral/ZG9jOjI1MTg5-custom-rulesets

2 Likes