Merged
Conversation
…m specified locations
…hemaManager Update the server to support bundle-based schemas using the schema library. On schema load the server now: - detects protobuf descriptor bundles and JSON schemas with $defs - extracts child schemas from the bundle - registers parent and child schemas in the schema repository - links children to the parent bundle - resolves message formatters through SchemaManager using SchemaResolver This allows topics to bind directly to protobuf message types or JSON $defs entries while the formatter resolves the parent bundle schema at runtime.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Support bundle schemas and child schema resolution
Overview
This change adds support for schema bundles in the server so that a single schema document can expose multiple usable schemas.
Two common cases are now supported:
$defsdefinitionsInstead of requiring each message type or definition to be stored as an individual schema, the server now:
This allows topics to bind directly to individual message types or
$defsentries while still using the original bundle schema as the source of truth.Key Changes
Schema bundle expansion
When a schema is loaded:
Protobuf
Descriptor sets are inspected and all message definitions are extracted.
Each message type becomes a child schema that references the parent descriptor bundle.
Example:
Each message is registered as a schema referencing the same descriptor bundle.
JSON
JSON schemas containing
$defsare treated as bundles.Each
$defsentry becomes a child schema referencing the parent schema via JSON Pointer.Example:
Children are registered with pointers like:
Parent-Child Schema Model
Child schemas are linked to their parent bundle.
The parent schema stores the actual schema material, while children store:
This avoids duplicating large schema documents or protobuf descriptors.
Formatter Resolution
Formatter creation now uses a resolver so child schemas can obtain their parent bundle when needed.
When parsing a message:
This ensures:
$refresolution continues to workTopic Binding
Topics can now bind directly to:
$defsdefinitionsExample:
The server resolves
Trackto the correct bundle definition automatically.Benefits
Testing
Tests added for:
$defsextractionResult
The server can now treat schema bundles as collections of usable schemas, enabling much simpler schema management for large schema sets.