Skip to content

Conversation

AnkurDedania
Copy link

@AnkurDedania AnkurDedania commented Jan 19, 2023

An approach to fix issues described in #166 where metadata configuration needs to be passed

AnkurDedania and others added 2 commits January 18, 2023 18:39
add support for union with metadata
@dairiki
Copy link
Collaborator

dairiki commented Jan 20, 2023

Thank you for the PR.

I’m not convinced that this is the correct solution to the issue.
When constructing a schema for:

@dataclass
class X
    y: Union[SomeType, OtherType] = field(metadata=some_metadata)

we need to construct three schema fields: one for SomeType, one for OtherType, and finally one for the Union. In the general case, it seems unreasonable to assume that we want to pass exactly the same custom metadata to all three of those fields.

I've just left a comment on #166 with more on this.

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