Skip to content

Conversation

@jmcarp
Copy link
Contributor

@jmcarp jmcarp commented Nov 19, 2025

Openapi represents an array of nullable items using an allOf with exactly one reference entry (items.allOf[0].$ref), rather than the usual items.$ref. We currently treat these types as any, which means users have to cast or marshal and unmarshal data to the correct type. This patch adds a check for this edge case and replaces the any with the appropriate concrete type.

Part of #340.

Openapi represents an array of nullable items using an allOf with exactly one
reference entry (items.allOf[0].$ref), rather than the usual items.$ref. We
currently treat these types as any, which means users have to cast or marshal
and unmarshal data to the correct type. This patch adds a check for this edge
case and replaces the any with the appropriate concrete type.

Part of #340.
@jmcarp jmcarp requested a review from a team as a code owner November 19, 2025 15:59
Copy link
Collaborator

@sudomateo sudomateo left a comment

Choose a reason for hiding this comment

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

This is clear to me and the Distributionint64 and Distributiondouble structs are already present in the SDK. Thanks for doing this!

@jmcarp jmcarp merged commit aed681a into main Nov 19, 2025
1 check passed
@jmcarp jmcarp deleted the jmcarp/handle-nullable-array branch November 19, 2025 17:19
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.

3 participants