-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
New interface for custom schema parser #480
Comments
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 🙏 |
Issue is resolved in v2 ParserJS - now in https://github.com/asyncapi/parser-js/tree/next-major branch |
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 (in2.0.0
version of lib it will be IntentAPI), andgetMimeTypes()
which returns the mime types that specify the given schema format. We are missing 3 functionsvalidate
, 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).
cc @jonaslagoni @smoya
The text was updated successfully, but these errors were encountered: