You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(produce): schema-aware Produce Record backend (UX-1292) (#2461)
* feat(produce): schema-aware Produce Record backend (UX-1292)
Adds schema-introspection + sample-generator infrastructure for the
schema-aware Produce Record flow:
- proto: new GenerateSchemaSample RPC; extended PublishMessagePayloadOptions
with optional schema_id / index_path so the wire format can address
nested Protobuf messages.
- backend/pkg/schemasample: schema-type-aware sample JSON generator (Avro /
Protobuf / JSON Schema), unit-tested.
- backend/pkg/console: GetSchemaRegistrySubjectDetails now embeds
per-version MessageTypes for Protobuf entries (descriptor walk via
cachedSchemaClient), so the produce UI can render a typed message-type
picker without a second RPC. /schema-registry/schemas endpoint + new
GetAllSchemas service method. Per-version message-type resolution
extracted to populateProtoMessageTypes helper to keep the parent
function under the cyclop ceiling.
- backend/pkg/serde: Protobuf+schemaId payloads now dispatch through the
schema-registry serde path so registered subjects resolve correctly.
* fix(produce): backend review fixes (UX-1292)
Addresses adversarial code review findings on PR #2461:
- JSON tags on MessageTypeInfo so the REST subject-details response uses
fullyQualifiedName/indexPath camelCase. Without tags Go encoded them as
FullyQualifiedName/IndexPath, breaking the frontend message-type picker.
- avroSamplePrimitiveOrRef no longer double-marks the visited flag. The
duplicate-flag bug caused the first reference to a non-recursive named
record to render as null instead of expanding the record's fields.
- walkMessageTypes skips synthetic map-entry descriptors so map<K,V> field
types don't appear as selectable message types in the produce UI.
- handleGetAllSchemas clamps Limit to 1000 (and defaults to 1000 when
unset) so an unbounded request can't pull MB-sized payloads.
- Regression test TestAvro_NonRecursiveRecordReference locks the
visited-flag fix.
* fix(produce): address PR review nits (UX-1292)
- drop redundant `i := i` loop alias (Go 1.22+ scopes per-iteration)
- use `slices.Clone` for prefix copy in `walkMessageTypes`
- shorten Avro/JSON-Schema constants block comment
0 commit comments