Skip to content

[Phase 4] MSSQL JSON - error handling + filter edge cases #3752

Description

@souvikghosh04

Parent

Part of #2768 (MSSQL native JSON data type support).

Summary

Phase 4 — error-handling and filter edge cases for SQL Server 2025 native JSON columns. Builds on the merged engine + schema-discovery work (#3691, #3720, #3738).

Scope (this issue / PR #3751)

  • US7 — REST: posting invalid JSON for a json column is rejected by SQL Server and surfaced as HTTP 400 (not 500), exercising the 13608–13614 → BadRequest mapping.
  • US7 — GraphQL: a createProfile mutation with malformed JSON fails with a GraphQL error rather than persisting bad data.
  • US9 — REST: filtering a json column as a string ($filter=metadata ne null) passes through to SQL and returns the non-null rows.

Deferred (pending CI observation)

  • Pruning 13608–13614: keep the full documented JSON-validation range until CI confirms the exact code(s) SQL 2025 emits — removing a code that actually fires would regress it to a 500.
  • Sort / equality on a json column: SQL Server disallows comparing/sorting the native json type (except IS [NOT] NULL), so $orderby=metadata / metadata eq '…' behavior + error-code mapping needs CI confirmation before asserting.
  • Polish: non-MSSQL regression check, dotnet format, quickstart smoke.

Notes

  • Tests only — no product code changes in this phase.
  • Requires SQL Server 2025 / Azure SQL (native json); CI already runs SQL 2025.

Delivery plan

Phase What Status
1 .NET 10 + SqlClient 6.x ✅ Merged (#3697/#3656)
2 JSON type + error mapping (engine) ✅ Merged (#3691)
3 Test fixture + REST CRUD tests ✅ Merged (#3720)
3b json-as-string read fix + OpenAPI/GraphQL tests ✅ Merged (#3738)
4 Error / filter edge cases 🚧 This issue

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status
Review In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions