Skip to content

Fix optional array properties incorrectly rejecting nil#177

Merged
sergiobayona merged 1 commit into
mainfrom
bugfix/optional-array-nil-rejection
Mar 9, 2026
Merged

Fix optional array properties incorrectly rejecting nil#177
sergiobayona merged 1 commit into
mainfrom
bugfix/optional-array-nil-rejection

Conversation

@sergiobayona

Copy link
Copy Markdown
Owner

array_requires_presence_validation? did not check @optional, so optional array properties added a nil-check that contradicted the JSON Schema (which correctly omitted the property from required). In Ruby an omitted property is indistinguishable from nil, so optional arrays must accept nil.

@sergiobayona

Copy link
Copy Markdown
Owner Author

/gemini-review

`array_requires_presence_validation?` did not check `@optional`,
so optional array properties added a nil-check that contradicted
the JSON Schema (which correctly omitted the property from
`required`). In Ruby an omitted property is indistinguishable
from nil, so optional arrays must accept nil.
@sergiobayona sergiobayona force-pushed the bugfix/optional-array-nil-rejection branch from dda9461 to 49e93c7 Compare March 9, 2026 18:02
@sergiobayona sergiobayona merged commit 9f64268 into main Mar 9, 2026
7 checks passed
@sergiobayona sergiobayona deleted the bugfix/optional-array-nil-rejection branch March 9, 2026 18:04
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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