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 issue with Option serialization #10705

Merged
merged 7 commits into from Nov 23, 2023

Conversation

hankjordan
Copy link
Contributor

Objective

Solution

  • Use .get_represented_type_info() module path and type ident instead of .reflect_* module path and type ident when serializing the Option enum

Changelog

  • Fix serialization bug
  • Add simple test
    • Add serde_json dev dependency
    • Add serde with derive feature dev dependency (wouldn't compile for me without it)

@hankjordan hankjordan added A-Reflection Runtime information about types C-Bug An unexpected or incorrect behavior labels Nov 23, 2023
@alice-i-cecile alice-i-cecile added this to the 0.12.1 milestone Nov 23, 2023
crates/bevy_reflect/src/serde/ser.rs Outdated Show resolved Hide resolved
crates/bevy_reflect/Cargo.toml Show resolved Hide resolved
Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
Copy link
Member

@MrGVSV MrGVSV left a comment

Choose a reason for hiding this comment

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

Not able to test this against the issue myself but the code looks good! Thanks for adding tests!

crates/bevy_reflect/src/serde/ser.rs Outdated Show resolved Hide resolved
crates/bevy_reflect/src/serde/ser.rs Outdated Show resolved Hide resolved
hankjordan and others added 2 commits November 23, 2023 02:03
Good find

Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 23, 2023
Merged via the queue into bevyengine:main with commit e85af0e Nov 23, 2023
26 checks passed
cart pushed a commit that referenced this pull request Nov 30, 2023
# Objective

- Fix #10499 

## Solution

- Use `.get_represented_type_info()` module path and type ident instead
of `.reflect_*` module path and type ident when serializing the `Option`
enum

---

## Changelog

- Fix serialization bug
- Add simple test
  - Add `serde_json` dev dependency
- Add `serde` with `derive` feature dev dependency (wouldn't compile for
me without it)

---------

Co-authored-by: hank <hank@hank.co.in>
Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- Fix bevyengine#10499 

## Solution

- Use `.get_represented_type_info()` module path and type ident instead
of `.reflect_*` module path and type ident when serializing the `Option`
enum

---

## Changelog

- Fix serialization bug
- Add simple test
  - Add `serde_json` dev dependency
- Add `serde` with `derive` feature dev dependency (wouldn't compile for
me without it)

---------

Co-authored-by: hank <hank@hank.co.in>
Co-authored-by: Gino Valente <49806985+MrGVSV@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Reflection Runtime information about types C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested structs cause DynamicScene to fail to deserialize
3 participants