[release/10.0-rc1] Model nullable types using oneOf in OpenAPI schema #63325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #63301 to release/10.0-rc1
/cc @captainsafia
Model nullable types using oneOf in OpenAPI schema
Add oneOf support for nullable complex types in OpenAPI schemas
Description
This change improves OpenAPI schema generation for nullable types by using the
oneOf
pattern instead of the nullable property for complex types and collections. The implementation:oneOf
with null and the actual type schema for nullable complex types in request/response schemasFixes #63301
Customer Impact
This change provides more accurate OpenAPI schema generation for nullable types, which improves:
Regression?
Risk
This is a low-risk change as it's a backport of an already-tested feature that improves schema generation without breaking existing functionality. The changes are isolated to OpenAPI schema generation logic and include new unit and integration tests for coverage. The implementation does consist of a breaking behavioral change so we'd like to get it in for RC1.
Verification
Packaging changes reviewed?