bevy/crates/bevy_reflect/src
Gino Valente 717def2ccf bevy_reflect: Fix deserialization with readers (#6894)
# Objective

Fixes #6891

## Solution

Replaces deserializing map keys as `&str` with deserializing them as `String`.

This bug seems to occur when using something like `File` or `BufReader` rather than bytes or a string directly (I only tested `File` and `BufReader` for `rmp-serde` and `serde_json`). This might be an issue with other `Read` impls as well (except `&[u8]` it seems).

We already had passing tests for Message Pack but none that use a `File` or `BufReader`. This PR also adds or modifies tests to check for this in the future.

This change was also based on [feedback](https://github.com/bevyengine/bevy/pull/4561#discussion_r957385136) I received in a previous PR.

---

## Changelog

- Fix bug where scene deserialization using certain readers could fail (e.g. `BufReader`, `File`, etc.)
2023-01-04 22:03:31 +00:00
..
enums bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
impls Add reflection support for VecDeque (#6831) 2022-12-11 18:22:08 +00:00
serde bevy_reflect: Fix deserialization with readers (#6894) 2023-01-04 22:03:31 +00:00
array.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
fields.rs bevy_reflect: Reflect doc comments (#6234) 2022-10-18 13:49:57 +00:00
from_reflect.rs bevy_reflect: Add ReflectFromReflect (v2) (#6245) 2022-12-11 17:52:48 +00:00
lib.rs bevy_reflect: Add ReflectFromReflect (v2) (#6245) 2022-12-11 17:52:48 +00:00
list.rs Updated docs for `List Trait in bevy_reflect` (#6872) 2022-12-07 23:10:25 +00:00
map.rs Add remove method to Map reflection trait. (#6564) 2022-11-14 21:03:39 +00:00
path.rs Make arrays behave like lists in reflection (#5987) 2022-09-27 18:11:38 +00:00
reflect.rs bevy_reflect: Add ReflectFromReflect (v2) (#6245) 2022-12-11 17:52:48 +00:00
std_traits.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
struct_trait.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
tuple_struct.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
tuple.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
type_info.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
type_registry.rs Add safe constructors for untyped pointers Ptr and PtrMut (#6539) 2022-11-14 22:53:50 +00:00
type_uuid.rs re-enable #[derive(TypeUuid)] for generics (#4118) 2022-04-26 19:41:25 +00:00
utility.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00