Skip to content

Support NSNull in OpenAPIContainer types #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

czechboy0
Copy link
Contributor

Motivation

When receiving containers from adopter code, there might be NSNull values, which represent a nil value.

Previously, this value would not be treated as nil, instead it'd throw an error as an unrecognized type.

Modifications

Handle NSNull and treat it as nil.

Result

You can provide a container with an NSNull nested value and it'll get encoded correctly.

Test Plan

Added a unit test.

@czechboy0 czechboy0 requested a review from simonjbeaumont July 17, 2024 14:01
Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch.

@czechboy0 czechboy0 enabled auto-merge (squash) July 17, 2024 14:24
@czechboy0 czechboy0 merged commit 39fa3ec into apple:main Jul 17, 2024
8 checks passed
@czechboy0 czechboy0 deleted the hd-support-nsnull-freeform-json branch July 17, 2024 15:37
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants