Context
The server (reductstore/reductstore#1371) now supports storing and retrieving schema/meta attachments in arbitrary formats (not just JSON). The storage uses the record's content_type to determine format. Existing JSON workflows are unchanged.
Required Changes
write_attachments
Add an optional content_type parameter (default: "application/json"):
- If content_type is JSON-like (
application/json, text/json, *+json): serialize values with the language's JSON encoder (current behavior, no change)
- Otherwise: accept raw bytes and pass them directly as the record payload with the given content_type
read_attachments
Branch on the record's content_type response header:
- If JSON-like: deserialize as today (no change)
- Otherwise: return raw bytes along with the content_type string
Acceptance Criteria
Notes
Parent issue: reductstore/reductstore#1371
Context
The server (reductstore/reductstore#1371) now supports storing and retrieving schema/meta attachments in arbitrary formats (not just JSON). The storage uses the record's
content_typeto determine format. Existing JSON workflows are unchanged.Required Changes
write_attachmentsAdd an optional
content_typeparameter (default:"application/json"):application/json,text/json,*+json): serialize values with the language's JSON encoder (current behavior, no change)read_attachmentsBranch on the record's
content_typeresponse header:Acceptance Criteria
write_attachmentsaccepts optionalcontent_typeparameterread_attachmentsreturns raw bytes + content_type for non-JSON recordsapplication/x-protobuf)Notes
$metaentry write path usesbegin_writewith an explicit content_type, so no server API changes are neededParent issue: reductstore/reductstore#1371