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

fix: flatten "base" in AssignmentEvent #46

Merged
merged 3 commits into from
Oct 16, 2024
Merged

fix: flatten "base" in AssignmentEvent #46

merged 3 commits into from
Oct 16, 2024

Conversation

rasendubi
Copy link
Collaborator

No description provided.

@@ -38,6 +38,7 @@ pub struct AssignmentEventBase {
#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct AssignmentEvent {
#[serde(flatten)]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"flatten" unpacks a nested structure into parent when serializing

)
assert result == "partial-example"

assert event["allocation"] == "partial-example"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this demonstrate that nested elements, like base are no longer present?

Copy link
Collaborator Author

@rasendubi rasendubi Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. the test fails without the flatten tag

@rasendubi rasendubi merged commit a2786af into main Oct 16, 2024
24 checks passed
@rasendubi rasendubi deleted the fix-flatten-base branch October 16, 2024 17:29
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.

3 participants