You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It will introduce breaking change so this should be done when rewriting the parser to the IntentAPI and TS
Reason/Context
Currently, custom parsers for the massage's payload (and in the 3.0.0 AsyncAPI version this will be made available to all schemas) have two methods: parse(), which parses the given format into an AsyncAPI JSON Schema, which is later used in ModelAPI (in 2.0.0 version of lib it will be IntentAPI), and getMimeTypes() which returns the mime types that specify the given schema format. We are missing 3 functions validate, which would return possible errors if a given schema has syntax errors.
Description
We should update all custom schema parsers to have that third function and it should be mandatory.
Due to the fact that RAML/OpenAPISchema/AVRO can be described using YAML or JSON we can easily validate them using JSON Schema and AJV and then combine the validation with Spectral from Stoplight (see more #477).
I wonder if there should be also a method that would validate the example based on the schema (use case asyncapi/studio#200). We can of course convert the format to AsyncAPI JSON Schema and validate on that, but I wonder if it would make sense. It should be discussed.
@magicmatatjahu I would love to work on this issue so I can get more knowledge on how Stoplight integrates with the Parser. It would need, however, to happen next week. Hope you are ok with that @magicmatatjahu 🙏
Activity
magicmatatjahu commentedon Mar 3, 2022
I wonder if there should be also a method that would validate the example based on the schema (use case asyncapi/studio#200). We can of course convert the format to AsyncAPI JSON Schema and validate on that, but I wonder if it would make sense. It should be discussed.
smoya commentedon Jun 27, 2022
@magicmatatjahu I would love to work on this issue so I can get more knowledge on how Stoplight integrates with the Parser. It would need, however, to happen next week. Hope you are ok with that @magicmatatjahu 🙏
magicmatatjahu commentedon Oct 25, 2022
Issue is resolved in v2 ParserJS - now in https://github.com/asyncapi/parser-js/tree/next-major branch