Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting with updated spectral version #48

Open
wirthual opened this issue Nov 29, 2021 · 5 comments
Open

Fix linting with updated spectral version #48

wirthual opened this issue Nov 29, 2021 · 5 comments

Comments

@wirthual
Copy link
Member

Spectral removed auto detection for openAPI schemas. Because of this, the linting fails when no .spectra.yaml is provided.

See: stoplightio/spectral#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

@LilithWittmann
Copy link
Member

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.

@wirthual
Copy link
Member Author

wirthual commented Dec 8, 2021

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
Copy link
Member Author

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
Copy link
Member Author

More here: stoplightio/spectral-action#221

@wirthual
Copy link
Member Author

wirthual commented Jan 5, 2022

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:
stoplightio/spectral-action#624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants