Feature/external native schema files#146
Merged
bascunansalvador merged 24 commits intoJun 18, 2026
Merged
Conversation
Introduce shared message header analysis so generated Spring Kafka producers and consumers can use typed header DTOs when AsyncAPI message headers are defined. The Spring Kafka model preparation now carries header type metadata through the analyzer, payload model, Java/Kotlin factories, and templates. Generated producer and consumer APIs now include typed header parameters for messages with headers, while no-header messages keep the existing simpler signatures. Producer templates now map non-null typed header values into Kafka record headers, and consumer templates expose the generated header type in handler signatures. Add tests covering header analysis, Java Spring Kafka generation, and Kotlin Spring Kafka generation so typed header imports, method signatures, and producer header mapping remain stable.
Feature/kafka client contract
…eration Feature/protobuf java payload generation
c27a850
into
feature/protobuf-runtime-generation
1 check passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous implementation required native Avro and native Protobuf schemas to be written inline inside the AsyncAPI document. That worked for small examples, but it was not ideal for real projects where
.avscand.protofiles are usually maintained as standalone schema assets.This was also inconsistent with how teams normally work with native schema formats. Avro and Protobuf schemas often have their own tooling, validation, build steps, and ownership, so forcing the schema text into the AsyncAPI YAML made the contract harder to maintain.
For the proposed solution, native Avro and native Protobuf schemas can now be referenced from the AsyncAPI document through
schema.$ref.For example, native Avro schemas can now be written like this:
Native Protobuf schemas can be written in the same style:
The external schema path is resolved relative to the AsyncAPI file that owns the reference. This reuses the existing external-reference path handling so native schema assets follow the same project-local reference behavior as other external files.
The parser now reads external native schema assets as plain text instead of routing them through the YAML or JSON document reader. This is important because
.avscand.protofiles are native schema assets, not AsyncAPI documents.A domain-specific parse error was also added for missing or unreadable native schema files. This means users get a clear generator error when a referenced
.avscor.protofile cannot be read, instead of a low-level file or parsing failure.The generator output contract was extended so external Avro files generate
.avscoutput and JavaSpecificRecordsources, and external Protobuf files generate.protooutput.Spring Kafka generation was also covered end to end. Java and Kotlin Spring Kafka clients now resolve payload types from external native Avro and Protobuf schema files in both full and simple client modes.
The README was updated to document both inline native schema usage and external native schema file references.
The test coverage includes parser tests for external native Avro and Protobuf schema assets, a missing-file parser diagnostic test, generator output contract tests for external
.avscand.protoassets, and Spring Kafka runtime generation tests for Java and Kotlin full/simple clients.