deutschland icon indicating copy to clipboard operation
deutschland copied to clipboard

Fix linting with updated spectral version

Open wirthual opened this issue 3 years ago • 5 comments

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

wirthual avatar Nov 29 '21 01:11 wirthual

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.

LilithWittmann avatar Dec 08 '21 17:12 LilithWittmann

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.

wirthual avatar Dec 08 '21 18:12 wirthual

I added a yaml with errors here: https://github.com/wirthual/autobahn-api/actions/runs/1564349269

This is the output I get: image

Which seems to be right?

wirthual avatar Dec 10 '21 16:12 wirthual

More here: https://github.com/stoplightio/spectral-action/issues/221

wirthual avatar Dec 20 '21 05:12 wirthual

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.

image

Lets see what the creators say: https://github.com/stoplightio/spectral-action/issues/624

wirthual avatar Jan 05 '22 05:01 wirthual