Skip to content

Require object values in serialization schemas - #3134

Merged
soutaro merged 3 commits into
ruby:masterfrom
OskarEichler:codex/schema-object-types
Sep 7, 2026
Merged

Require object values in serialization schemas#3134
soutaro merged 3 commits into
ruby:masterfrom
OskarEichler:codex/schema-object-types

Conversation

@OskarEichler

Copy link
Copy Markdown
Contributor

Summary

  • declare the function serialization payload as a JSON object
  • declare include, extend, prepend, attribute, and alias members as JSON objects
  • reject scalar, array, and null values that currently bypass properties and required

Reproduction

Draft-04 validation ignores properties and required for non-object instances unless an object type is declared. As a result, the six affected definitions currently accept values such as null, 1, "value", and [] even though their serialized forms are objects.

Verification

  • existing schema suite: 11/11 passing
  • external negative model: invalid primitive values are rejected and representative serialized objects remain accepted
  • current primary plus stdlib suites: 4,140 tests / 66,231 assertions / 0 failures / 0 errors
  • native build and complete signature validation
  • all nine generated template outputs remain byte-identical
  • Rust parser: 47 tests, formatting, and Clippy with warnings denied

No runtime or generated API behavior changes for valid serialized objects.

@soutaro soutaro self-assigned this Sep 7, 2026
@soutaro
soutaro enabled auto-merge September 7, 2026 07:59
@soutaro
soutaro added this pull request to the merge queue Sep 7, 2026
Merged via the queue into ruby:master with commit 613b6ef Sep 7, 2026
23 checks passed
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