Comments (3)
@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.
Hi, I tried the example and it failed in the same way.
- Example has
x-custome-key
: UserDeleted instead ofx-custom-key
(just a typo) - 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.
@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)
- unknown format "int32" is used in schema HOT 6
- Feature: Support for operationId HOT 3
- custom validation: how to call validate() HOT 5
- What's the preferred way to handle invalid messages? HOT 2
- Question - CLI wrapper HOT 3
- Package asyncapi is deprecated HOT 1
- JSON references to external files are not resolved correctly HOT 1
- How to use validate() with channel with parameter? HOT 4
- Expose TypeScript types HOT 1
- Bug: Validation fails with exclusiveMinimum / exclusiveMaximum in schema HOT 1
- Can find msgIdentifier for fallowing schema HOT 8
- [QA] how to get property from Error object? HOT 7
- Feature: Use ajv-formats to validate data formats
- Invalid message gets marked valid? HOT 3
- Question: Circular References in the scheme HOT 5
- How to determine message from topic, with variables? HOT 1
- Does not support avro in AsynApi HOT 1
- Question: How to validate messages with Headers HOT 1
- Does not support version 3.0.0 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncapi-validator.