Skip to content

add support for union with metadata #166 - #231

Open
AbsoluteMSTR wants to merge 2 commits into
lovasoa:masterfrom
AbsoluteMSTR:bug/166-union
Open

add support for union with metadata #166#231
AbsoluteMSTR wants to merge 2 commits into
lovasoa:masterfrom
AbsoluteMSTR:bug/166-union

Conversation

@AbsoluteMSTR

@AbsoluteMSTR AbsoluteMSTR commented Jan 19, 2023

Copy link
Copy Markdown

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

AbsoluteMSTR and others added 2 commits January 18, 2023 18:39
add support for union with metadata
@dairiki

dairiki commented Jan 20, 2023

Copy link
Copy Markdown
Collaborator

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