bevy/crates/bevy_reflect/src
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
..
enums bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
func Remove Return::Unit variant (#15484) 2024-09-28 16:26:55 +00:00
impls bevy_reflect: Add DeserializeWithRegistry and SerializeWithRegistry (#8611) 2024-10-02 01:54:32 +00:00
path Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
serde Serialize and deserialize tuple struct with one field as newtype struct (#15628) 2024-10-07 23:40:03 +00:00
array.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
attributes.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
fields.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
from_reflect.rs bevy_reflect: Update on_unimplemented attributes (#15110) 2024-09-09 16:26:17 +00:00
generics.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
kind.rs Fix ReflectKind description wording (#15498) 2024-09-28 16:26:00 +00:00
lib.rs Documentation for variadics (#15387) 2024-10-02 12:48:36 +00:00
list.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
map.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
reflect.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
reflectable.rs bevy_reflect: Add Reflectable trait (#5772) 2024-09-18 00:36:41 +00:00
remote.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
set.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
std_traits.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
struct_trait.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
tuple_struct.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
tuple.rs Documentation for variadics (#15387) 2024-10-02 12:48:36 +00:00
type_info_stack.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
type_info.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00
type_path.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
type_registry.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
utility.rs bevy_reflect: Generic parameter info (#15475) 2024-09-30 17:58:37 +00:00