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

@asyncapi/avro-schema-parser

Package Overview
Dependencies
Maintainers
3
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asyncapi/avro-schema-parser

An AsyncAPI schema parser for Avro 1.x schemas.

  • 3.0.24
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is @asyncapi/avro-schema-parser?

@asyncapi/avro-schema-parser is an npm package designed to parse Avro schemas within the context of AsyncAPI documents. It allows developers to integrate Avro schema parsing capabilities into their AsyncAPI workflows, enabling seamless schema validation and manipulation.

What are @asyncapi/avro-schema-parser's main functionalities?

Parse Avro Schema

This feature allows you to parse an Avro schema string into a JavaScript object. The code sample demonstrates how to use the AvroSchemaParser to parse a simple Avro schema for a 'User' record.

const { AvroSchemaParser } = require('@asyncapi/avro-schema-parser');
const parser = new AvroSchemaParser();
const avroSchema = `{
  "type": "record",
  "name": "User",
  "fields": [
    { "name": "name", "type": "string" },
    { "name": "age", "type": "int" }
  ]
}`;
parser.parse(avroSchema).then(parsedSchema => {
  console.log(parsedSchema);
}).catch(err => {
  console.error(err);
});

Validate Avro Schema

This feature allows you to validate an Avro schema string. The code sample demonstrates how to use the AvroSchemaParser to validate a simple Avro schema for a 'User' record.

const { AvroSchemaParser } = require('@asyncapi/avro-schema-parser');
const parser = new AvroSchemaParser();
const avroSchema = `{
  "type": "record",
  "name": "User",
  "fields": [
    { "name": "name", "type": "string" },
    { "name": "age", "type": "int" }
  ]
}`;
parser.validate(avroSchema).then(() => {
  console.log('Schema is valid');
}).catch(err => {
  console.error('Schema is invalid:', err);
});

Other packages similar to @asyncapi/avro-schema-parser

Keywords

FAQs

Package last updated on 12 Jun 2024

Did you know?

Socket

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.

Install

Related posts

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