← 返回首页
GitHub - AsyncAPITools/parser-java-wrapper: AsyncAPI Parser Java Wrapper ( over JavaScript Parser ) · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

AsyncAPITools/parser-java-wrapper

Go to file
Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
View all files

Repository files navigation

AsyncAPI Parser Java Wrapper ( over JavaScript Parser )

Overview

Use this library to parse and validate AsyncAPI documents —either YAML or JSON— in your Java application. It is a Java wrapper over JavaScript Parser implemented using J2V8.

Prerequisites

  • Java 11
  • Maven 3.x

Installation

To install the parser, run the following commands

git clone https://github.com/AsyncAPITools/parser-java-wrapper cd parser-java-wrapper mvn clean install

Usage

To use in your Java project, add following dependeny

For Maven ( pom.xml )

<dependency> <groupId>org.asyncapi.tools</groupId> <artifactId>parser-java-wrapper</artifactId> <version>1.0.0</version> </dependency>

For gradle ( build.gradle )

implementation group: 'org.asyncapi.tools', name: 'parser-java-wrapper', version: '1.0.0'

Example

Example passing inline AsyncAPI

Object result = AsyncAPIParser.parse( "asyncapi: 2.4.0\n" + "info:\n" + " title: Account Service\n" + " version: '1.0.0'\n" + " description: |\n" + " Manages user accounts in the system.\n" + " license:\n" + " name: Apache 2.0\n" + " url: https://www.apache.org/licenses/LICENSE-2.0\n" + "\n" + "servers:\n" + " production:\n" + " url: mqtt://test.mosquitto.org\n" + " protocol: mqtt\n" + " description: Test MQTT broker\n" + "\n" + "channels:\n" + " user/signedup:\n" + " subscribe:\n" + " operationId: emitUserSignUpEvent\n" + " message:\n" + " $ref : '#/components/messages/UserSignedUp'\n" + "\n" + "components:\n" + " messages:\n" + " UserSignedUp:\n" + " name: userSignedUp\n" + " title: User signed up event\n" + " summary: Inform about a new user registration in the system\n" + " contentType: application/json\n" + " payload:\n" + " $ref: '#/components/schemas/userSignedUpPayload'\n" + "\n" + " schemas:\n" + " userSignedUpPayload:\n" + " type: object\n" + " properties:\n" + " firstName:\n" + " type: string\n" + " description: 'foo'\n" + " lastName:\n" + " type: string\n" + " description: 'bar'\n" + " email:\n" + " type: string\n" + " format: email\n" + " description: 'baz'\n" + " createdAt:\n" + " type: string\n" + " format: date-time "); System.out.println("parse result: " + result);

Example passing a URL

Object result = AsyncAPIParser.parseFromUrl(new URL("https://raw.githubusercontent.com/asyncapi/spec/master/examples/simple.yml")); System.out.println("stream result : " + result);

About

AsyncAPI Parser Java Wrapper ( over JavaScript Parser )

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Footer

© 2026 GitHub, Inc.