Skip to content

Preserve omitted additionalProperties - #1

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/preserve-additional-properties-presence
Aug 13, 2026
Merged

Preserve omitted additionalProperties#1
ChiragAgg5k merged 1 commit into
mainfrom
fix/preserve-additional-properties-presence

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Keep an omitted additionalProperties distinct from an explicit true. Both permit unknown properties according to OpenAPI semantics, but downstream consumers may need to preserve whether the keyword was present.\n\n- use null for an omitted keyword\n- retain explicit booleans and typed schemas\n- cover omitted and explicit-open object schemas\n\ncomposer test and composer check pass.

@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown

Greptile Summary

The PR preserves the distinction between an omitted additionalProperties keyword and an explicit true.

  • Makes ObjectSchema::$additionalProperties nullable and defaults it to null.
  • Updates schema parsing to retain omission while preserving booleans and typed schemas.
  • Adds reader coverage for omitted and explicitly open object schemas.

Confidence Score: 5/5

The PR appears safe to merge with no concrete changed-code failure identified.

The parser and model consistently preserve omission as null, explicit values retain their prior representations, and no repository consumer mishandles the new nullable state.

Important Files Changed

Filename Overview
src/Model/Schema/ObjectSchema.php Extends the public property type with null and changes its default to represent an omitted keyword.
src/Parser/Schema/Reader.php Preserves omission as null while continuing to parse explicit booleans and schema-valued additionalProperties.
tests/Schema/ReaderTest.php Adds focused assertions distinguishing omitted additionalProperties from explicit true.

Fix All in Greploop

Reviews (1): Last reviewed commit: "fix: preserve omitted additional propert..." | Re-trigger Greptile

@ChiragAgg5k
ChiragAgg5k merged commit ae73061 into main Aug 13, 2026
5 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/preserve-additional-properties-presence branch August 13, 2026 13:50
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.

1 participant