generator icon indicating copy to clipboard operation
generator copied to clipboard

[📑 Docs]: Provide content for `Parser` document

Open derberg opened this issue 3 years ago • 1 comments

What Dev Docs changes are you proposing?

https://github.com/asyncapi/generator/blob/master/docs/parser.md

I'm still not 100% sure that Parser is a good name of the document. Maybe it should just be a part of a different document. What do you think?

Nevertheless the scope is:

  • generator uses AsyncAPI JS Parser to first validate if the AsyncAPI file provided by the user follows the specification. At the end, Parser returns AsyncAPIDocument instance with a set of helper functions that enable easier access to contents of AsyncAPI file
  • share simple example. Maybe show AsyncAPI document in JSON format with a message in it. Simple document (you can modify streetlight example) that has 2 channels and each has one operation with one message. Show how you would access single message by operating on simple JSON. And then explain "what if you want to list all messages". And say "yeah, this is what parser is for, as AsyncAPIDocument gives you access to allMessages() that returns a Map of all the messages. Link to https://github.com/asyncapi/parser-js/blob/master/API.md
  • mention that in generator not only parser is included but also its plugins for parsing schema formats like avro, or openapi schema. Tell user that usage of parser allows template developer to also easily access schema provided in avro or other formats because the JavaScript parser converts these into JSON Schema.
  • in the end say that AsyncAPIDocument is part of the template context -> and of course link to the document that will be created :smiley:

cc @pratik2315 @Florence-Njeri

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

derberg avatar Jul 21 '22 14:07 derberg

Hey there! I'll be working on this issue for Parser documentation.

pratik9315 avatar Sep 27 '22 12:09 pratik9315

:tada: This issue has been resolved in version 1.9.15 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Jan 17 '23 16:01 asyncapi-bot