Features #
- AsyncAPI 3.x specification
- Majority of AsyncAPI entities
- JSONSchema support
- Extensible object types and formats
- Content types
- Automatic resolving the
$refs- Fetching files from HTTP, local file or by executing the user shell command
- Specification extensions (
x-*fields), that control the code generation process - Security schemes
- Generating the boilerplate code
- Abstract code for any protocol, even if it not well-known
- Additional support code for some protocols sufficient for basic send-receive functionality
- Flexible codegen process control: excluding entities, publish-only / subscribe-only generation, etc.
- Setting any structure of the generated code using code layout
- Zero allocation support
- Abstract code for any protocol, even if it not well-known
- Generating the no-code CLI application executable with basic send-receive functionality
- Generating the server definitions for the supported engines.
- Visualizing AsyncAPI documents in diagrams
- SVG, D2 formats
- Channel-centric, server-centric and combined views
- Plenty of customization options
- Themes support
- Documentation web UI
- Customization the output by user templates in text/template format
- Manipulating the AsyncAPI documents:
- Validating the documents against the AsyncAPI specification
- Flattening the documents by replacing
$refs with the actual content - Copying and moving the nodes between documents with automatic fixing all related
$refs - Generating synthetic examples for the messages and schemas
- Inspecting the documents and their nodes
- Showing documents dependency tree
- Configuring via YAML configuration file
- Verbose logging in debug and trace levels
AsyncAPI 2.x is not supported and not planned for support in the future, because it has significant differences with 3.x version which requires too much effort to make both versions to work in one tool. Please, use the asyncapi converter to convert your 2.x documents to 3.x.
Protocols #
Here are the protocols that are supported by go-asyncapi for now:
AsyncAPI support #
The marked items below are supported by the go-asyncapi tool (partially or fully), unmarked items are in the roadmap.
For the reference, see AsyncAPI specification
AsyncAPI Entities #
- AsyncAPI object
- Identifier object (
$id) - Info object
- Contact object
- License object
- Default Content Type[1]
- Servers object
- Server object
- Server Variable object
- Server Bindings object
- Server object
- Channels object
- Channel object
- Channel Bindings object
- Channel object
- Messages object
- Message object
- Message Example object
- Message Bindings object
- Message Trait object
- Message Bindings object
- Message object
- Operations object
- Operation object
- Operation Trait object
- Operation Reply object
- Operation Reply Address object
- Operation Bindings object
- Operation object
- Parameters object
- Parameter object
- Tags object
- Tag object
- External Documentation object
- Components object
- Security Scheme object[2]
- OAuth Flows object
- OAuth Flow object
- Correlation ID object
Other #
- Reference object (
$ref) - Channel Address Expressions
- Multi Format Schema object
- Runtime Expression
- Traits merge mechanism
JSONSchema #
AsyncAPI uses superset of JSON Schema Specification Draft 07 for message payloads and other schema definitions. See AsyncAPI spec.
The following JSONSchema features are supported by go-asyncapi:
-
type[3] -
additionalItems -
additionalProperties -
allOf -
anyOf -
const -
contains -
default -
definitions -
deprecated -
description -
discriminator -
else -
enum -
examples -
exclusiveMaximum -
exclusiveMinimum -
externalDocs -
format[3] -
if -
items -
maxItems -
maxLength -
maxProperties -
maximum -
minItems -
minLength -
minProperties -
minimum -
multipleOf -
not -
oneOf -
pattern -
patternProperties -
properties -
propertyNames -
readOnly -
required -
then -
title -
uniqueItems
Types and formats #
JSONSchema formats are extensible by user, see more.
The following object types and formats are supported by go-asyncapi out-of-the-box:
object:struct,map[T1]T2, etc., depending on the schema definitionarray:[]T,[x]T, depending on the schema definitionboolean:boolstring:stringdate-time,datetime: time.Timeipv4,ipv6: net.IPuuid: github.com/google/uuidbinary,bytes:[]byte
integer:intint8:int8int16:int16int32:int32int64:int64uint:uintuint8:uint8uint16:uint16uint32:uint32uint64:uint64
number:float64float:float32double:float64decimal: github.com/shopspring/decimal
null:any
Content types #
Content types are extensible by user, see more.
The following content types (MIME types) are supported by go-asyncapi out-of-the-box:
application/json: encoding/jsonapplication/yaml,application/x-yaml,text/yaml: gopkg.in/yaml.v3application/binary: encoding/gobtext/plain: built-in conversion to/from stringapplication/xml: encoding/xml
Security schemes #
Security schemes are extensible by user, see more.
The following security scheme types are supported by go-asyncapi:
-
userPassword -
apiKey -
X509 -
symmetricEncryption -
asymmetricEncryption -
httpApiKey -
http -
oauth2 -
openIdConnect -
plain -
scramSha256 -
scramSha512 -
gssapi
Server definitions generation #
The go-asyncapi tool supports the generation for the following engines:
