Skip to content

Conversation

@cschiewek
Copy link
Member

@cschiewek cschiewek commented Oct 30, 2025

This PR adds support for the @oneOf schema directive that was officially added to the spec in September.

It adds:

  • The directive definition to the prototype.
  • A schema validation phase that ensures correct usage in schemas
  • A document validation phase that ensure correct usage in operations
  • Tests

It also updates both pipeline functions to include the 2 new phases.

@cschiewek cschiewek force-pushed the cschiewek/@oneOf branch 6 times, most recently from 9d1a9f4 to 819d930 Compare November 1, 2025 23:44
@cschiewek cschiewek marked this pull request as ready for review November 5, 2025 17:49
@cschiewek cschiewek requested a review from a team November 5, 2025 17:49
Comment on lines +18 to +19
# Ignore input objects without schema nodes
defp process(%Argument{input_value: %{normalized: %Object{schema_node: nil}}} = node), do: node
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a valid case where an input object wouldn't have a schema_node?

Copy link
Member Author

@cschiewek cschiewek Nov 5, 2025

Choose a reason for hiding this comment

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

No. If there's no schema_node, there's no __private__ field, so no chance that it has :one_of.

I'm not exactly sure when or why these are sometimes nil, but ignoring nodes with a schema_node is pretty common in phases (one example).

Copy link
Contributor

@michaelcaterisano michaelcaterisano left a comment

Choose a reason for hiding this comment

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

Thanks for adding this!

@cschiewek cschiewek merged commit 01e8e4b into main Nov 5, 2025
23 checks passed
@cschiewek cschiewek deleted the cschiewek/@oneOf branch November 5, 2025 20:37
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