parser-js
parser-js copied to clipboard
Add validation of message examples
Reason/Context
Have a mechanism that validates examples of payload. Examples are used as part of rendered docs and by mocking tools and should be 100% accurate.
Description
Ajv doesn't want to be responsible for examples validation, but it could be done with Ajv plugin, all details here. I did not find any available plugin at the moment. Knowing that Ajv is now under development to support the latest JSON Schema, and it affects Ajv architecture as the plan is to rewrite with TypeScript, I would suggest waiting until they are done with it.
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This one is still very much needed. Should not be complicated because it is about comparing data against schema, and ajv is already used in the parser
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:
+1 To validating examples. It would be a nice to have and a quick way to get feedback on the schema and the example(s) for it.
@Weffe would it be something you could help with contributing, I can guide you
We are also interested in a validation.
In the context of writing tests or even in the production code itself it makes sense to validate event payload types.
For our rest api which is documented in OpenApi3 we use this library: https://www.npmjs.com/package/api-schema-builder. It provides an easy to use validation mechanism which we use as part of our test infrastructure.
E.g. the schema which is created by this library could provide a validation()
function.
test() {
// do some things
// ...
// validate
const message = await getMessage()
schema.validate(channel, 'publish', message.payload)
}
@MerzDaniel Hello! Thanks for comment!
Please note that this issue is related to the validation of the examples not after the validation of the specification but during the validation, this means that the user passing the specification to the parser should receive errors/information regarding badly formatted examples for message's payload and headers. As far as your idea is concerned I recommend to create separate issue because it concerns two different things :) Sooner or later we will need a similar feature so I would really ask you to create a separate issue, thanks!
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart:
Still valid and it will be resolved in the v2 version.
Issue is resolved in v2 ParserJS - now in https://github.com/asyncapi/parser-js/tree/next-major branch