bevy/crates/bevy_reflect/src/serde
notmd cab00766d9
Serialize and deserialize tuple struct with one field as newtype struct (#15628)
# Objective

- fix https://github.com/bevyengine/bevy/issues/15623
## Solution

- Checking field length of tuple struct before ser/der

## Testing

- CI should pass

## Migration Guide

- Reflection now will serialize and deserialize tuple struct with single
field as newtype struct. Consider this code.
```rs
#[derive(Reflect, Serialize)]
struct Test(usize);
let reflect = Test(3);
let serializer = TypedReflectSerializer::new(reflect.as_partial_reflect(), &registry);
return serde_json::to_string(&serializer)
```
Old behavior will return `["3"]`. New behavior will return `"3"`. If you
were relying on old behavior you need to update your logic. Especially
with `serde_json`. `ron` doesn't affect from this.
2024-10-07 23:40:03 +00:00
..
de Serialize and deserialize tuple struct with one field as newtype struct (#15628) 2024-10-07 23:40:03 +00:00
ser Serialize and deserialize tuple struct with one field as newtype struct (#15628) 2024-10-07 23:40:03 +00:00
mod.rs Serialize and deserialize tuple struct with one field as newtype struct (#15628) 2024-10-07 23:40:03 +00:00
type_data.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00