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

collection of tagged union deserialization bug fixed. #207

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

dapper91
Copy link
Owner

Fixes the bug when a field of a tagged union collection type:

class FloatSubModel(BaseXmlModel):
    type: Literal['float'] = attr()
    data: float


class StringSubModel(BaseXmlModel):
    type: Literal['string'] = attr()
    data: str


TaggedUnion = Annotated[Union[FloatData, StringData], Field(discriminator='type')]

class Model(BaseXmlModel):
    collection: list[TaggedUnion]

Fixes the issue #206

@codecov-commenter
Copy link

codecov-commenter commented Aug 26, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.89%. Comparing base (3b81aeb) to head (a62b518).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #207      +/-   ##
==========================================
+ Coverage   91.83%   91.89%   +0.06%     
==========================================
  Files          29       29              
  Lines        1617     1617              
==========================================
+ Hits         1485     1486       +1     
+ Misses        132      131       -1     
Flag Coverage Δ
unittests 91.89% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dapper91 dapper91 changed the title collection of tagged union bug fixed. collection of tagged union deserialization bug fixed. Aug 26, 2024
@dapper91 dapper91 merged commit 9bddcb8 into dev Aug 26, 2024
5 checks passed
@dapper91 dapper91 deleted the tagged-union-bugfix branch September 20, 2024 13:36
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