Skip to content
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

oneOf fails to match when block txs is empty #243

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

lightclient
Copy link
Member

In cases where transactions is an empty array [], the oneOf keyword matches both array items since it can't differentiate. This causes schema validation to fail, because oneOf must match only one of the item subschemas.

Two possible fixes:

  1. Change oneOf to anyOf. The subschemas deviate enough that the only time both can match is in the case of an empty array.
  2. Keep oneOf but set minItems of one of the item schemas to 1. This way, the empty array would only match one item.

I went with option 1) because it seems more correct. Under 2), the schema would make the distinction that the empty array is definitely one item type or the other, when in reality there isn't enough information for it to make that conclusion.

@lightclient lightclient merged commit 797b2ab into ethereum:main Jun 21, 2022
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.

1 participant