Skip to content

Add validation of message examples #99

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

Closed
Tracked by #481
derberg opened this issue Jun 30, 2020 · 16 comments
Closed
Tracked by #481

Add validation of message examples #99

derberg opened this issue Jun 30, 2020 · 16 comments
Labels
enhancement New feature or request

Comments

@derberg
Copy link
Member

derberg commented Jun 30, 2020

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.

@derberg derberg added the enhancement New feature or request label Jun 30, 2020
@derberg derberg changed the title Add validation of examples Add validation of message examples Jun 30, 2020
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

1 similar comment
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions github-actions bot added the stale label Dec 30, 2020
@derberg derberg removed the stale label Jan 4, 2021
@github-actions
Copy link

github-actions bot commented Mar 6, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions
Copy link

github-actions bot commented May 8, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions github-actions bot added the stale label May 8, 2021
@derberg derberg removed the stale label May 9, 2021
@derberg
Copy link
Member Author

derberg commented May 9, 2021

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

@github-actions
Copy link

github-actions bot commented Jul 9, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@github-actions github-actions bot added the stale label Jul 9, 2021
@derberg derberg removed the stale label Jul 9, 2021
@github-actions
Copy link

github-actions bot commented Sep 8, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
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 ❤️

@Weffe
Copy link

Weffe commented Sep 28, 2021

+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.

@derberg
Copy link
Member Author

derberg commented Sep 29, 2021

@Weffe would it be something you could help with contributing, I can guide you

@magicmatatjahu magicmatatjahu added Hacktoberfest Label issues as available for participants of https://hacktoberfest.digitalocean.com good first issue Good for newcomers labels Sep 29, 2021
@MerzDaniel
Copy link

MerzDaniel commented Jan 3, 2022

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)
}

@magicmatatjahu
Copy link
Member

@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!

@magicmatatjahu magicmatatjahu mentioned this issue Mar 3, 2022
20 tasks
@github-actions
Copy link

github-actions bot commented May 4, 2022

This issue has been automatically marked as stale because it has not had recent activity 😴

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 ❤️

@github-actions github-actions bot added the stale label May 4, 2022
@derberg derberg removed the stale label May 10, 2022
@github-actions
Copy link

github-actions bot commented Sep 8, 2022

This issue has been automatically marked as stale because it has not had recent activity 😴

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 ❤️

@github-actions github-actions bot added the stale label Sep 8, 2022
@magicmatatjahu
Copy link
Member

Still valid and it will be resolved in the v2 version.

@github-actions github-actions bot removed the stale label Sep 9, 2022
@derberg derberg added area/javascript Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. and removed good first issue Good for newcomers Hacktoberfest Label issues as available for participants of https://hacktoberfest.digitalocean.com area/javascript Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. labels Oct 3, 2022
@magicmatatjahu
Copy link
Member

Issue is resolved in v2 ParserJS - now in https://github.com/asyncapi/parser-js/tree/next-major branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants