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 1.4.5 to 1.5.0

2

lib/anonymousNaming.js

@@ -75,3 +75,3 @@ const {xParserMessageName, xParserSchemaId} = require('./constants');

messages.forEach(m => {
if (m.name() === undefined) {
if (m.name() === undefined && m.ext(xParserMessageName) === undefined) {
m.json()[String(xParserMessageName)] = `<anonymous-message-${number}>`;

@@ -78,0 +78,0 @@ }

@@ -0,1 +1,2 @@

const xParserSpecParsed = 'x-parser-spec-parsed';
const xParserMessageName = 'x-parser-message-name';

@@ -5,3 +6,5 @@ const xParserSchemaId = 'x-parser-schema-id';

const xParserCircleProps = 'x-parser-circular-props';
module.exports = {
xParserSpecParsed,
xParserMessageName,

@@ -8,0 +11,0 @@ xParserSchemaId,

@@ -11,3 +11,3 @@ const { createMapOfType, getMapValueOfType, mix } = require('./utils');

const MixinSpecificationExtensions = require('../mixins/specification-extensions');
const {xParserCircle, xParserCircleProps} = require('../constants');
const {xParserSpecParsed, xParserCircle, xParserCircleProps} = require('../constants');
const {assignNameToAnonymousMessages, assignNameToComponentMessages, assignUidToComponentSchemas, assignUidToParameterSchemas, assignIdToAnonymousSchemas} = require('../anonymousNaming');

@@ -27,7 +27,14 @@ const {traverseAsyncApiDocument, SchemaIteratorCallbackType} = require('../iterators');

class AsyncAPIDocument extends Base {
/**
* @constructor
*/
constructor(...args) {
super(...args);
if (this.ext(xParserSpecParsed) === true) {
return;
}
assignNameToComponentMessages(this);
assignNameToAnonymousMessages(this);
assignNameToComponentMessages(this);

@@ -38,2 +45,7 @@ markCircularSchemas(this);

assignIdToAnonymousSchemas(this);
// We add `x-parser-spec-parsed=true` extension to determine that the specification is parsed and validated
// and when the specification is re-passed to the AsyncAPIDocument constructor,
// there is no need to perform the same operations.
this.json()[String(xParserSpecParsed)] = true;
}

@@ -40,0 +52,0 @@

{
"name": "@asyncapi/parser",
"version": "1.4.5",
"version": "1.5.0",
"description": "JavaScript AsyncAPI parser.",

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

@@ -144,2 +144,5 @@ /**

}
/**
* Implements functions to deal with the AsyncAPI document.
*/
class AsyncAPIDocument extends Base implements MixinTags, MixinExternalDocs, MixinSpecificationExtensions {

@@ -146,0 +149,0 @@ version(): string;

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