diff --git a/springwolf-ui/src/app/components/channels/channel-main/channel-main.component.ts b/springwolf-ui/src/app/components/channels/channel-main/channel-main.component.ts index f71cd0af6..402b8bd94 100644 --- a/springwolf-ui/src/app/components/channels/channel-main/channel-main.component.ts +++ b/springwolf-ui/src/app/components/channels/channel-main/channel-main.component.ts @@ -55,10 +55,7 @@ export class ChannelMainComponent implements OnInit { this.exampleTextAreaLineCount = this.defaultExample?.lineCount || 1; this.defaultExampleType = this.operation().message.payload.name; - this.headersSchemaIdentifier = - this.operation().message.headers.name.slice( - this.operation().message.headers.name.lastIndexOf("/") + 1 - ); + this.headersSchemaIdentifier = this.operation().message.headers.name; this.headers = schemas.get(this.headersSchemaIdentifier)!!; this.headersExample = this.headers.example || noExample; this.headersTextAreaLineCount = this.headersExample?.lineCount || 1; diff --git a/springwolf-ui/src/app/components/new/channels/channel-main/channel-operation.component.ts b/springwolf-ui/src/app/components/new/channels/channel-main/channel-operation.component.ts index 32b31ff24..96ec6f3aa 100644 --- a/springwolf-ui/src/app/components/new/channels/channel-main/channel-operation.component.ts +++ b/springwolf-ui/src/app/components/new/channels/channel-main/channel-operation.component.ts @@ -61,10 +61,7 @@ export class ChannelOperationComponent implements OnInit { this.exampleContentType = this.operation().message.contentType.split("/").pop() || "json"; - const headersSchemaIdentifier = - this.operation().message.headers.name.slice( - this.operation().message.headers.name.lastIndexOf("/") + 1 - ); + const headersSchemaIdentifier = this.operation().message.headers.name; this.headers = schemas.get(headersSchemaIdentifier)!!; this.originalHeadersExample = this.headers.example || noExample; diff --git a/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts b/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts index 7739f8041..612aa0496 100644 --- a/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts +++ b/springwolf-ui/src/app/service/asyncapi/asyncapi-mapper.service.ts @@ -276,7 +276,7 @@ export class AsyncApiMapperService { anchorUrl: AsyncApiMapperService.BASE_URL + payloadName, }, headers: { - name: message.headers.$ref, + name: this.resolveRefId(message.headers.$ref), title: this.resolveRefId(message.headers.$ref) || "undefined-header-title", @@ -558,6 +558,13 @@ export class AsyncApiMapperService { type: "channel", }); } + if (channelOperation.operation.message.headers.name === schema.name) { + schema.usedBy.push({ + name: channelOperation.name, + anchorUrl: channelOperation.anchorUrl!!, + type: "channel", + }); + } }); });