Skip to content

Commit

Permalink
fix(ui): fix publishing for custom payloadType
Browse files Browse the repository at this point in the history
For example in combination with `@AsyncMessage#name`
  • Loading branch information
timonback committed May 19, 2024
1 parent 6f69894 commit 50d998b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import io.github.springwolf.core.asyncapi.annotations.AsyncApiPayload;
import io.github.springwolf.core.asyncapi.annotations.AsyncListener;
import io.github.springwolf.core.asyncapi.annotations.AsyncMessage;
import io.github.springwolf.core.asyncapi.annotations.AsyncOperation;
import io.github.springwolf.plugins.kafka.asyncapi.annotations.KafkaAsyncOperationBinding;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -28,6 +29,7 @@ public class StringConsumer {
description =
"Final classes (like String) can be documented using an envelope class and the @AsyncApiPayload annotation.",
payloadType = StringEnvelope.class,
message = @AsyncMessage(name = "StringPayload"),
headers = @AsyncOperation.Headers(notUsed = true)))
@KafkaAsyncOperationBinding
public void receiveStringPayload(String stringPayload) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@
"$ref": "#/components/schemas/io.github.springwolf.examples.kafka.consumers.StringConsumer$StringEnvelope"
}
},
"name": "io.github.springwolf.examples.kafka.consumers.StringConsumer$StringEnvelope",
"name": "StringPayload",
"title": "StringEnvelope",
"description": "Payload description using @Schema annotation and @AsyncApiPayload within envelope class",
"bindings": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class ChannelMainComponent implements OnInit {

this.defaultExample = this.schema.example;
this.exampleTextAreaLineCount = this.defaultExample?.lineCount || 1;
this.defaultExampleType = this.operation.message.name;
this.defaultExampleType = this.operation.message.payload.type;

this.headersSchemaIdentifier = this.operation.message.headers.name.slice(
this.operation.message.headers.name.lastIndexOf("/") + 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export class AsyncApiMapperService {
payload: {
name: message.payload.schema.$ref,
title: this.resolveRef(message.payload.schema.$ref),
type: this.resolveRef(message.payload.schema.$ref),
anchorUrl:
AsyncApiMapperService.BASE_URL +
this.resolveRef(message.payload.schema.$ref),
Expand Down

0 comments on commit 50d998b

Please sign in to comment.