Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@asyncapi/parser

Package Overview
Dependencies
Maintainers
3
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asyncapi/parser - npm Package Compare versions

Comparing version 0.28.1 to 0.28.2

5

lib/asyncapiSchemaFormatParser.js

@@ -15,2 +15,5 @@ const Ajv = require('ajv');

async function parse({ message, originalAsyncAPIDocument, fileFormat, parsedAsyncAPIDocument, pathToPayload }) {
const payload = message.payload;
if (!payload) return;
const ajv = new Ajv({

@@ -24,3 +27,3 @@ jsonPointers: true,

const validate = ajv.compile(payloadSchema);
const valid = validate(message.payload);
const valid = validate(payload);

@@ -27,0 +30,0 @@ if (!valid) throw new ParserError({

2

package.json
{
"name": "@asyncapi/parser",
"version": "0.28.1",
"version": "0.28.2",
"description": "JavaScript AsyncAPI parser.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -80,2 +80,23 @@ const parser = require('../lib');

});
it('should not throw error if payload not provided', async function() {
const inputString = `{
"asyncapi": "2.0.0",
"info": {
"title": "My API",
"version": "1.0.0"
},
"channels": {
"mychannel": {
"publish": {
"message": {
}
}
}
}
}`;
const parsedInput = JSON.parse(inputString);
expect(async () => await parser.parse(parsedInput)).to.not.throw();
});
});

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc