springwolf / springwolf-core

Automated documentation for event-driven applications built with Spring Boot
https://www.springwolf.dev
Apache License 2.0
255 stars 77 forks source link

Is there any library to validate the ascynapi documents and show the errors in documents ? #1021

Open ajit2k21 opened 1 month ago

ajit2k21 commented 1 month ago

Created asyncapi document and tested it with springwolf-ui sample application. But it gives errors with springwolf-ui but giving no error with official AscynAPI UI (https://studio.asyncapi.com/). Can you please check the ascynapi file asyncapi-sample.json whether I missed anything in this file or not.

github-actions[bot] commented 1 month ago

Welcome to Springwolf. Thanks a lot for reporting your first issue. Please check out our contributors guide and feel free to join us on discord.

timonback commented 1 month ago

Hi @ajit2k21, there is no library for it and I considered it also as a non-goal.

Note: springwolf-ui doesn't support the full AsyncAPI spec. Source: https://www.springwolf.dev/docs/faq

You can use springwolf-examples/springwolf-kafka-example/src/test/resources/asyncapi.json as a reference for the structure. Additionally, you can edit that file while running the npm start dev server in springwolf-ui and verify that no typescript errors are outputted.


As a general question, what are you trying to achieve? Have you considered using the async api renderer, since you use a non Springwolf-generated asyncapi file?

The AsyncApi renderer supports the full spec. Example: https://github.com/timonback/springwolf-asyncapi-ui/blob/main/template/index.ejs using the AsyncAPI library https://github.com/asyncapi/asyncapi-react