Skip to content

doc/shape: add top-level contentMediaType to all shapes#2945

Open
mdibaiee wants to merge 2 commits into
masterfrom
mahdi/shape-contentType
Open

doc/shape: add top-level contentMediaType to all shapes#2945
mdibaiee wants to merge 2 commits into
masterfrom
mahdi/shape-contentType

Conversation

@mdibaiee
Copy link
Copy Markdown
Member

@mdibaiee mdibaiee commented May 14, 2026

Description:

  • Previouly we had content_type for string shapes specifically (this matches JSONSchema's spec), which referred to JSONSchema's contentMediaType
  • With this pull-request we are lifting contentMediaType to apply to all types, and the naming is now consistent with JSONSchema. This allows schemas such as:
{
  "type": "object",
  "contentMediaType": "application/vnd.estuary.psql.jsonb+json",
  "properties": { ... }
}

Which we intend to use for conveying more information about type of fields from captures to materializations (See example: estuary/connectors#4400

  • Regenerating the proto files using prost-build lends some formatting differences which are in a separate commit

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

(anything that might help someone review this PR)

Copy link
Copy Markdown
Member

@jgraettinger jgraettinger left a comment

Choose a reason for hiding this comment

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

LGTM, small comment nit

Comment thread crates/doc/src/shape/inference.rs Outdated
- redact: {strategy: sha256}
- default: john.doe@gmail.com
# `contentMediaType` is now a top-level Shape field, so the
# union of `{contentMediaType: x}` with `{type: null}` drops
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: this behavior looks right but the comment doesn't make sense to me.

Rather, when intersecting schemas, if one schema doesn't have an opinion (doesn't set contentMediaType), we allow a Some on another schema to take effect -- but then remove it if there's disagreement.

When unioning, we require all unioned schemas have the same Some to carry it forward into the union'd Shape.

@mdibaiee mdibaiee force-pushed the mahdi/shape-contentType branch 2 times, most recently from d364bf7 to 56975f0 Compare May 15, 2026 18:06
mdibaiee added 2 commits May 15, 2026 19:32
Mechanical regeneration only; no .proto changes. Captures formatting
shifts from the local prost-build/protoc toolchain (e.g. `*` -> `-`
bullets in doc comments, multi-line attribute reflow, type-parameter
line breaks). Splitting this from the next commit so review can focus
on the functional diff.
@mdibaiee mdibaiee force-pushed the mahdi/shape-contentType branch from 56975f0 to 84f3e3e Compare May 15, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants