Giter Site home page Giter Site logo

Comments (3)

WaleedAshraf avatar WaleedAshraf commented on May 27, 2024

@karlwbrown
About components/messages: That was fixed in a new release a few weeks ago. Now, it also works if there are no components/messages. I have kept the old implementation also for backward compatibility.

Check this example: https://github.com/WaleedAshraf/asyncapi-validator#example-with-channel-validation

About other files, I have not tested that case. I think it should work as I parse (resolve all $refs) the schema first before doing the validation. And then use validate it like this.

payloadSchema = this._channels[channel][operation][key].payload

from asyncapi-validator.

karloskalcium avatar karloskalcium commented on May 27, 2024

Hi, I tried the example and it failed in the same way.

  1. Example has x-custome-key: UserDeleted instead of x-custom-key (just a typo)
  2. Once that is fixed I still get the same message using that example. I am using 2.4.1
(node:43185) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'messages' of undefined
    at new MessageValidator (/Users/kbrown/dev/va/pa-event-injector/node_modules/asyncapi-validator/src/MessageValidator.js:15:46)
    at ValidatorFactory.fromSource (/Users/kbrown/dev/va/pa-event-injector/node_modules/asyncapi-validator/src/ValidatorFactory.js:28:12)
    at async validateEvent (/Users/kbrown/dev/va/pa-event-injector/event-injector/src/test/js/validate-event.js:7:10)
(node:43185) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

from asyncapi-validator.

WaleedAshraf avatar WaleedAshraf commented on May 27, 2024

@karlwbrown thanks for pointing this out.
I have fixed the issue. Let me know if you are still facing any problem.

from asyncapi-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.