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

@kyma-project/asyncapi-react

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kyma-project/asyncapi-react

A React component for AsyncAPI specification.

  • 0.16.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-33.33%
Maintainers
2
Weekly downloads
 
Created
Source
AsyncAPI logo
React Component
A official React component for AsyncAPI 2.0 specification

All Contributors

Overview

A official React component for AsyncAPI 2.0 specification. It allows you to render the documentation of your asynchronous API provided in the AsyncAPI specification format and validate this specification. You can fully restyle the component using your own styles.

CAUTION: This package only supports AsyncAPI 2.0 specification. If you use 1.x, we recommend that you upgrade to the latest AsyncAPI version using the Node.js or Go converters.

Playground

This repository comes in with a Playground application. Test it to see the component in action and play with it before you use it in your application.

You can also run the Playground application locally by following this instruction from the development guide.

Prerequisites

Installation

Run this command to install the component in your project:

npm install --save @kyma-project/asyncapi-react

Check out this simple sandbox application that uses the asyncapi-react component:

Edit asyncapi-react-in-action

Props

The list of props for the AsyncAPI React component includes:

  • schema: string | AsyncApiInterface | FetchingSchemaInterface

    The schema property is required and contains AsyncAPI specification. Use the string type, the AsyncApiInterface type, or the FetchingSchemaInterface object to fetch the schema from an external resource. For more information on what it contains and what it should look like, read AsyncAPI Specification.

  • config?: Partial<ConfigInterface>

    The config property is optional and contains configuration for the AsyncAPI component. For more information on the available configuration options, read the Configuration Modification document. This property is concatenated with the default configuration.

    NOTE: The Partial<T> type means that every field in the T type is optional.

Features

For a list and description of features offered by the AsyncAPI React component, see this directory.

Styles

To use default styles based on SAP Fundamentals, import them as follows:

import "@kyma-project/asyncapi-react/lib/styles/fiori.css";

For information on how to change styles, read the Style Modification document.

Web Component

If you are not using React you may want to use the @kyma-project/asyncapi-react component as a plain web component. This is achieved by making use of web-react-components.

Installation

Run this command to install the component in your project:

npm install --save @asyncapi/web-component

Using in Angular

To use component in Angular, follow these steps:

  1. Update AppModule by adding the CUSTOM_ELEMENTS_SCHEMA to the schemas array in the NgModule metadata:
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

@NgModule({
  ...
  schemas: [
    CUSTOM_ELEMENTS_SCHEMA,
  ]
})
export class AppModule {}
  1. Import the @asyncapi/web-component module in an Angular's component where you want to use the web component:
import { Component } from '@angular/core';
import '@asyncapi/web-component/lib/asyncapi-web-component';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  ...
}
  1. Use web component in the template as follows:
<asyncapi-component [schema]="schema" [config]="config" [cssImportPath]="cssImportPath"></asyncapi-component>

where:

  • schema is a schema property from React component,
  • config is a config property from React component,
  • cssImportPath is the path to styles. By default it is assets/fiori.css

NOTE: The easiest way to use the default css is to copy the content of the @kyma-project/asyncapi-react/lib/styles/fiori.css file to a assets/asyncapi.css file.

Development

For information on how to set up a development environment, write and run tests, follow the naming and architecture convention defined for the project in the Development Guide.

Releasing

For information on how to release a new version of the library or the playground application, or details on creating a changelog file, read the Releasing document.

Contribution

If you have a feature request, add it as an issue or propose changes in a pull request (PR). If you create a feature request, use the dedicated Feature request issue template. When you create a PR, follow the contributing rules described in the CONTRIBUTING.md document.

If you have a bug to report, reproduce it in an online code editor. For example, use CodeSandbox. Attach the link to the reproduced bug to your issue. Log the bug using the Bug report template.

Missing features

See the list of features that are still missing in the component:

If you want to help us develop them, feel free to contribute.

Credits

Contributors

Thanks goes to these wonderful people (emoji key):


Maciej Urbańczyk

💻 📖 🤔 🚧 👀 ⚠️

Karolina Zydek

📖 👀 🚧

Agata

💻 🚧

Lukasz Gornicki

📖 💡 🤔

Mateusz Puczyński

💻 📖 🤔 🚧 👀 ⚠️

Hesyar Uzuner

🐛 💻

Marcus Ilgner

🐛 💻

Dominik Henneke

💻

Oliver Sand

💻

Jakub Iwanowski

💻

depimomo

⚠️

Sanskar Patro

💻

danielchu

🚇

Fran Méndez

💻 🚧

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

FAQs

Package last updated on 16 Nov 2020

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