Skip to content

Add validation of message examples #99

Closed

Description

@derberg

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.

Activity

  1. added
    enhancement
    on Jun 30, 2020
  2. changed the title [-]Add validation of examples[/-] [+]Add validation of message examples[/+] on Jun 30, 2020
  3. github-actions commented on Aug 31, 2020

    @github-actions

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

  4. github-actions commented on Oct 30, 2020

    @github-actions

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

  5. github-actions commented on Dec 30, 2020

    @github-actions

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

  6. github-actions commented on Mar 6, 2021

    @github-actions

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

  7. github-actions commented on May 8, 2021

    @github-actions

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

  8. 11 remaining items

  9. MerzDaniel commented on Jan 3, 2022

    @MerzDaniel

    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)
    }
    
  10. magicmatatjahu commented on Jan 3, 2022

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

  11. github-actions commented on May 4, 2022

    @github-actions

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

  12. github-actions commented on Sep 8, 2022

    @github-actions

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

  13. magicmatatjahu commented on Sep 8, 2022

    @magicmatatjahu
    Member

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

  14. added
    area/javascript
    and removed
    good first issue
    Hacktoberfest
    area/javascript
    on Oct 3, 2022
  15. magicmatatjahu commented on Oct 25, 2022

    @magicmatatjahu
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions