Skip to content

Commit

Permalink
Make edit header view available by default in ui
Browse files Browse the repository at this point in the history
Problem - no schema for headers (varied json) defined in Kafka Listeners.

Scenario - user wants to send custom headers in springwolf kafka ui, headers are not defined in schema and changes in internal implementation.

Now there are two workarounds to this

1) Define headers for schema using annotations
2) Add example to schema HeadersNotDocumented
  • Loading branch information
victorlev01 authored Mar 13, 2024
1 parent 33f7353 commit 4cc8b0c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h4>Message Binding</h4>
"
></textarea>
</div>
<div [hidden]="!(headersExample?.lineCount > 1)" class="flex-column">
<div class="flex-column">
<h4>Header</h4>
<textarea
spellcheck="false"
Expand Down

1 comment on commit 4cc8b0c

@victorlev01
Copy link
Contributor Author

@victorlev01 victorlev01 commented on 4cc8b0c Mar 13, 2024

Choose a reason for hiding this comment

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

Now we are using workaround like this in AsyncApiCustomizer implementation :

@Override
public void customize(AsyncAPI asyncAPI) {
            var components = asyncAPI.getComponents();
            var notDocumentedHeaders = components.getSchemas().get("HeadersNotDocumented");
            notDocumentedHeaders.setType("object");
            var exampleHeader = new HashMap<String, String>();
            exampleHeader.put("key", "value");
            notDocumentedHeaders.setExamples(List.of(exampleHeader));

It will be great if headers view were not hidden out of the box by default

Please sign in to comment.