Skip to content

Commit

Permalink
feat!: add support for AsyncAPI v3 (#526)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergio Moya <1083296+smoya@users.noreply.github.com>%0ACo-authored-by: asyncapi-bot <bot+chan@asyncapi.io>%0ACo-authored-by: Fran Mendez <fmvilas@gmail.com>%0ACo-authored-by: Fran Méndez <fmvilas@gmail.com>%0ACo-authored-by: Heiko Henning <greenrover33@gmail.com>%0ACo-authored-by: souvik <souvikde.ns@gmail.com>%0ACo-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>%0ACo-authored-by: Matatjahu <urbanczyk.maciej.95@gmail.com>
  • Loading branch information
jonaslagoni and magicmatatjahu committed Dec 1, 2023
1 parent 5c833ce commit 4799f2a
Show file tree
Hide file tree
Showing 143 changed files with 11,811 additions and 3,256 deletions.
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Disable specific duplicate code since it would introduce more complexity to reduce it.
sonar.cpd.exclusions=src/models/**/*.ts
sonar.cpd.exclusions=src/models/**/*.ts,src/spec-types/*.ts
sonar.exclusions=test/**/*
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Updated bundle for the browser is always attached to the GitHub Release.
> This package has rewrote the Model API (old one) to [Intent API](https://github.com/asyncapi/parser-api). If you still need to use the old API, read the [Convert to the old API](#convert-to-the-old-api) section.
> **Note**
> Read the [migration guide from v1 to v2](./docs/migrations/v1-to-v2.md).
> Read the [migration guide from v2 to v3](./docs/migrations/v2-to-v3.md).

<!-- toc is generated with GitHub Actions do not remove toc markers -->
Expand Down Expand Up @@ -214,9 +214,10 @@ Parser-JS API implements a global API definition for all AsyncAPI parser impleme

The following table shows a compatibility matrix between this parser, and the [Parser-API](https://github.com/asyncapi/parser-api), as well as the AsyncAPI spec version supported by each release of this parser.

| Parser-JS | Parser-API | Spec 2.x |
|-----------|----------------------------------------------------------------------|----------|
| 2.x | [1.x](https://github.com/asyncapi/parser-api/blob/master/docs/v1.md) ||
| Parser-JS | Parser-API | Spec 2.x | Spec 3.x |
|-----------|-----------------------------------------------------------------------|----------|----------|
| 2.x | [1.x](https://github.com/asyncapi/parser-api/blob/v1.0.0/docs/v1.md) || |
| 3.x | [3.x](https://github.com/asyncapi/parser-api/blob/v3.0.0/docs/api.md) |||

- `` Fully supported version.
- `-` The AsyncAPI Spec version has features the Parser-JS can't use but the rest are fully supported.
Expand Down
26 changes: 26 additions & 0 deletions docs/migrations/v2-to-v3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Migrating from v2 to v3

The ONLY thing that changes between v2 and v3 is that we now use [parser API v3](https://github.com/asyncapi/parser-api/commit/954a59e41ccdb70de51eb43901f61b79198fbb51) where v2 used [parser API v1](https://github.com/asyncapi/parser-api/commit/7dab1eeb796f8c8c079e5d0c4d671d55a60bc8ca).

## Parser API v1 to v3
There are only very few changes, for message and message traits.

## Message

```diff
- - messageId(): `string` | `undefined`
- - schemaFormat(): `string`
+ - schemaFormat(): `string` | `undefined`
```

Since `messageId` have been removed, you need to use `id` instead.

## MessageTrait

```diff
- - messageId(): `string` | `undefined`
- - schemaFormat(): `string`
+ - schemaFormat(): `string` | `undefined`
```

Since `messageId` have been removed, you need to use `id` instead.

0 comments on commit 4799f2a

Please sign in to comment.