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

circumvent errors with dynamic or string arrays in oneOfs #1057

Closed
wants to merge 1 commit into from

Conversation

Leptopoda
Copy link
Member

required for #980
This is a hacks that just uses the first match in a oneOf to avoid failing when multiple values match.

In theory the normal built_value serializer does include the original type before in the serialized type but this is stripped when a FullType is specified.
I don't know yet how we can get access to this information with the StandardJsonPlugin enabled.
I plan to investigate other methods and take these issues into consideration when working on #1049.

@provokateurin
Copy link
Member

This might backfire because the problematic type might not be the last one but before the one that is actually correct. So we would need to treat oneOf as anyOf for now as the problem can still happen with this change.

@Leptopoda
Copy link
Member Author

You are right. I didn't think about this.

What about not trying to fix this issue in dynamite and just patch the spreed spec to be anyOf?
I think for now this is the cleanest and easiest we can do.

@provokateurin
Copy link
Member

Hm yeah that sounds like a good idea. The same thing will also happen in server, but there it only affects two places which we don't even use right now.

@Leptopoda
Copy link
Member Author

I've documented this issue in #1058 so I'll close this one for now.

@Leptopoda Leptopoda closed this Oct 30, 2023
@provokateurin
Copy link
Member

The branch can be deleted?

@Leptopoda Leptopoda deleted the fix/dynamite/circumvent_oneof_array branch October 30, 2023 15:38
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.

2 participants