-
Notifications
You must be signed in to change notification settings - Fork 21
feat: parser adapter for json in asyncapi3 #5048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
packages/apidom-parser-adapter-asyncapi-json-3/test/__snapshots__/adapter.mjs.snap
Show resolved
Hide resolved
glowcloud
left a comment
There was a problem hiding this 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', |
There was a problem hiding this comment.
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.
| '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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| '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. |
There was a problem hiding this comment.
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:
| [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') { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
Parser adapter for asyncapi JSON 3