Skip to content

Fix serialization of value when its type is different type than the ivar#514

Merged
Blacksmoke16 merged 2 commits intomasterfrom
value-diff-type
Feb 4, 2025
Merged

Fix serialization of value when its type is different type than the ivar#514
Blacksmoke16 merged 2 commits intomasterfrom
value-diff-type

Conversation

@Blacksmoke16
Copy link
Copy Markdown
Member

Context

The logic was previously assuming the type of the ivar and the type of the value were the same, which could technically not be true when using accessor.

Fixes #513

Changelog

  • Fix serialization of value when its type is different type than the ivar

Before merging, remember to add the athena-framework/athena prefix to the PR number in the PR title

@Blacksmoke16 Blacksmoke16 added kind:bug An existing feature isn't working as expected component:serializer labels Feb 4, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/components/serializer/spec/models/accessor.cr 75.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (93.33%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Flag Coverage Δ
compiled 18.53% <6.66%> (-0.01%) ⬇️
unit 96.63% <93.33%> (-0.01%) ⬇️

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

Components Coverage Δ
clock 100.00% <ø> (ø)
console 97.09% <ø> (ø)
dependency_injection 97.89% <ø> (ø)
dotenv 98.58% <ø> (ø)
event_dispatcher 95.46% <ø> (ø)
framework 98.13% <ø> (ø)
image_size 96.63% <ø> (ø)
mercure 94.95% <ø> (ø)
mime 98.56% <ø> (ø)
negotiation 97.94% <ø> (ø)
routing 98.39% <ø> (ø)
serializer 96.51% <93.33%> (-0.04%) ⬇️
spec 96.29% <ø> (ø)
validator 95.87% <ø> (ø)

📢 Thoughts on this report? Let us know!

@Blacksmoke16 Blacksmoke16 merged commit ec59a80 into master Feb 4, 2025
@Blacksmoke16 Blacksmoke16 deleted the value-diff-type branch February 4, 2025 16:01
PallasAthenaie pushed a commit to athena-framework/serializer that referenced this pull request Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:serializer kind:bug An existing feature isn't working as expected

Development

Successfully merging this pull request may close these issues.

Bug: serialization getter must return the same type as the property

1 participant