deutschland
deutschland copied to clipboard
Fix linting with updated spectral version
Spectral removed auto detection for openAPI schemas. Because of this, the linting fails when no .spectra.yaml is provided.
See: https://github.com/stoplightio/spectral/issues/1796
In the Autobahn repo there is a .spectral.yaml file to account for that.
However, if we do not expect to use custom linting rulesets, we can simply get rid of this extra file by executing this before the linting process:
echo "extends: spectral:oas" > .spectral.yaml
Hmm in the autobahn api still seems to be an issue that spectral does not show details about the linting errors/the pipeline dosen't fail because of them.
Thats interesting. I thought it would not fail if there are only warnings but if there are errors it does. Can you create a test branch with a wrong yaml to be able to test this?
Looks like spectral did a lot of changes with the newest versions.
I added a yaml with errors here: https://github.com/wirthual/autobahn-api/actions/runs/1564349269
This is the output I get:
Which seems to be right?
More here: https://github.com/stoplightio/spectral-action/issues/221
Looks like there is also an issue with pull_requests as seen in the autobahn-api. Not sure what special permission or tokens the spectral-action needs to perform linting, but it seems to be a problem.
Lets see what the creators say: https://github.com/stoplightio/spectral-action/issues/624