springwolf-core icon indicating copy to clipboard operation
springwolf-core copied to clipboard

Lint AsyncApi docs

Open timonback opened this issue 3 years ago • 1 comments

Lint created asyncApi.json files with spectral as recommended on the asyncApi blog: https://www.asyncapi.com/blog/creating-consistency-announcing-asyncapi-spectral-together#steps-to-utilizing-asyncapi--spectral

The asyncApi.json Map Header is removed, this will require also UI changes from https://github.com/springwolf/springwolf-ui/pull/8

Fixed non-compliant asyncApi issues (info block, operationId)

timonback avatar Sep 16 '22 16:09 timonback

Info: This must be merged in sync with the UI changes, which might require a (couple) review iteration.

timonback avatar Sep 16 '22 18:09 timonback

Another thought - adding a validation during the build phase will be more effective. There is none available that I know of, but when there will be we should add it as well.

stavshamir avatar Oct 15 '22 07:10 stavshamir

Another thought - adding a validation during the build phase will be more effective. There is none available that I know of, but when there will be we should add it as well.

Agreed. During build time would be when the spring application starts up and not compiler errors, right? I am also not aware of such a package. I could imagine a springwolf-asyncapi-validator package, which runs validation on the AsyncAPI pojo - made available by the DefaultAsyncApiService as bean?

timonback avatar Oct 15 '22 09:10 timonback

Another thought - adding a validation during the build phase will be more effective. There is none available that I know of, but when there will be we should add it as well.

Agreed. During build time would be when the spring application starts up and not compiler errors, right? I am also not aware of such a package. I could imagine a springwolf-asyncapi-validator package, which runs validation on the AsyncAPI pojo - made available by the DefaultAsyncApiService as bean?

I would argue that springwolf should not be able to generate invalid async api docs, so I would have the validation fail the core/plugins build, not at the user side.

And yes, we can create a new module for the validator. It is a lot of effort I assume, and the github actions linter is a good start.

stavshamir avatar Oct 15 '22 10:10 stavshamir