Skip to content

Conversation

@cka121
Copy link
Contributor

@cka121 cka121 commented Nov 17, 2025

Parser adapter for asyncapi JSON 3

@cka121 cka121 marked this pull request as ready for review November 18, 2025 09:41
@cka121 cka121 requested a review from glowcloud November 19, 2025 10:44
Copy link
Contributor

@glowcloud glowcloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, just small nitpicks.

[
'application/vnd.aai.asyncapi;version=3.0.0',
'application/vnd.aai.asyncapi+json;version=3.0.0',
'application/vnd.aai.asyncapi+yaml;version=3.0.0',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the YAML versions here as this is only JSON parser.

Suggested change
'application/vnd.aai.asyncapi+yaml;version=3.0.0',

'application/vnd.aai.asyncapi+yaml;version=3.0.0',
'application/vnd.aai.asyncapi;version=3.0.1',
'application/vnd.aai.asyncapi+json;version=3.0.1',
'application/vnd.aai.asyncapi+yaml;version=3.0.1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'application/vnd.aai.asyncapi+yaml;version=3.0.1',


### detect

[Detection](https://github.com/swagger-api/apidom/blob/main/packages/apidom-parser-adapter-asyncapi-json-3/src/adapter.ts#L13) is based on a regular expression matching required AsyncApi 3.0.0 specification symbols in JSON format.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should point to the detect function:

Suggested change
[Detection](https://github.com/swagger-api/apidom/blob/main/packages/apidom-parser-adapter-asyncapi-json-3/src/adapter.ts#L13) is based on a regular expression matching required AsyncApi 3.0.0 specification symbols in JSON format.
[Detection](https://github.com/swagger-api/apidom/blob/main/packages/apidom-parser-adapter-asyncapi-json-3/src/adapter.ts#L18) is based on a regular expression matching required AsyncApi 3.0.0 specification symbols in JSON format.

let processedText;
const nameSpace = await findNamespace(text, this.settings?.defaultContentLanguage);
// TODO: Turned off validation, because we will implement it in the future.
if (nameSpace.namespace === 'asyncapi' && nameSpace.version === '3.0.0') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to turn it off for the 3.0.1 version as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants