Skip to content

Commit

Permalink
fix: AsyncAPI v3 shows warning in Studio and IntelliJ plugin when ref…
Browse files Browse the repository at this point in the history
…erencing a json schema

Add clarification comment for fix

asyncapi#494
asyncapi/jasyncapi-idea-plugin#49
  • Loading branch information
Pakisan committed Mar 12, 2024
1 parent 87a6097 commit 981c80d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/bundler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ function getDefinitionName(def) {
if (def.startsWith('http://asyncapi.com/bindings')) {
const result = bindingsRegex.exec(def);
if (result) {
/*
4th element is for internal definitions like http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property
When is empty, we can ignore it:
convert this: http://asyncapi.com/bindings/jms/0.0.1/server.json
to this: bindings-jms-0.0.1-server
Otherwise we MUST add it to not broke Json Schema validation:
convert this: http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property
to this: bindings-jms-0.0.1-server/definitions/property
*/
if (result[4] === '') {
return `${result[1].replace('/', '-')}-${result[2]}-${result[3]}`;
}
Expand Down

0 comments on commit 981c80d

Please sign in to comment.