Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@asyncapi/openapi-schema-parser
Advanced tools
An AsyncAPI schema parser for OpenAPI 3.0.x and Swagger 2.x schemas.
An AsyncAPI schema parser for OpenAPI 3.0.x and Swagger 2.x schemas.
Note Version >=
3.0.0
of package is only supported by@asyncapi/parser
version >=2.0.0
.
npm install @asyncapi/openapi-schema-parser
// OR
yarn add @asyncapi/openapi-schema-parser
import { Parser } from '@asyncapi/parser';
import { OpenAPISchemaParser } from '@asyncapi/openapi-schema-parser';
const parser = new Parser();
parser.registerSchemaParser(OpenAPISchemaParser());
const asyncapiWithOpenAPI = `
asyncapi: 2.0.0
info:
title: Example with OpenAPI
version: 0.1.0
channels:
example:
publish:
message:
schemaFormat: 'application/vnd.oai.openapi;version=3.0.0'
payload: # The following is an OpenAPI schema
type: object
properties:
title:
type: string
nullable: true
author:
type: string
example: Jack Johnson
`;
const { document } = await parser.parse(asyncapiWithOpenAPI);
const { Parser } = require('@asyncapi/parser');
const { OpenAPISchemaParser } = require('@asyncapi/openapi-schema-parser');
const parser = new Parser();
parser.registerSchemaParser(OpenAPISchemaParser());
const asyncapiWithOpenAPI = `
asyncapi: 2.0.0
info:
title: Example with OpenAPI
version: 0.1.0
channels:
example:
publish:
message:
schemaFormat: 'application/vnd.oai.openapi;version=3.0.0'
payload: # The following is an OpenAPI schema
type: object
properties:
title:
type: string
nullable: true
author:
type: string
example: Jack Johnson
`;
const { document } = await parser.parse(asyncapiWithOpenAPI);
It also supports referencing remote OpenAPI schemas:
import { Parser } from '@asyncapi/parser';
import { OpenAPISchemaParser } from '@asyncapi/openapi-schema-parser';
const parser = new Parser();
parser.registerSchemaParser(OpenAPISchemaParser());
const asyncapiWithOpenAPI = `
asyncapi: 2.0.0
info:
title: Example with OpenAPI
version: 0.1.0
channels:
example:
publish:
message:
schemaFormat: 'application/vnd.oai.openapi;version=3.0.0'
payload:
$ref: 'yourserver.com/schemas#/Book'
`;
const { document } = await parser.parse(asyncapiWithOpenAPI);
FAQs
An AsyncAPI schema parser for OpenAPI 3.0.x and Swagger 2.x schemas.
The npm package @asyncapi/openapi-schema-parser receives a total of 126,008 weekly downloads. As such, @asyncapi/openapi-schema-parser popularity was classified as popular.
We found that @asyncapi/openapi-schema-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.