Skip to content

[9.x] Fix explicit JSON column types for owned collections - #3990

Merged
roji merged 1 commit into
hotfix/9.0.5from
roji-json-column-type-fix-9x
Oct 17, 2026
Merged

roji merged 1 commit into
hotfix/9.0.5from
roji-json-column-type-fix-9x

Conversation

@roji

@roji roji commented Oct 17, 2026

Copy link
Copy Markdown
Member

Configuring ToJson().HasColumnType("json") or an explicit jsonb column type selects the weak JsonElement mapping on 9.x, causing query compilation to fail with a JsonElement-to-MemoryStream coercion error.

Register the owned JSON mappings for both store types. Extend the existing JsonElement convention to handle column-type changes so actual JSON DOM properties retain their weak mappings, including nullable properties and reconfigured column types.

Adds owned-collection roundtrip coverage for explicit json/jsonb and regression coverage for weak DOM mapping selection. Verified the original failure before applying the fix; afterward, 212 mapping tests and 154 related JSON functional tests passed, with only existing skips.

Fixes #3475

Register owned JSON mappings for explicit json/jsonb column types and preserve weak JsonElement mappings through the existing property convention.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 6a1ca7ca-13ab-4d3d-b14e-5705bfdfad85
@roji
roji merged commit b7382b3 into hotfix/9.0.5 Oct 17, 2026
10 checks passed
@roji
roji deleted the roji-json-column-type-fix-9x branch October 17, 2026 11:09
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.

Specifying ToJson().HasColumnType("json") make querying throw an exception

1 participant