Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: ObjectList handle missing apiVersion and kind during deserialization The `serde` crate has a bug that prevents the proper deserialization of attributes that are using the `flatten` and `default` directives. See [1] and [2]. This bug affects the freshly introduced `ObjectList.types` attribute. It's not possible to deserialize an `ObjectList` that is missing the `apiVersion` and/or the `kind` values. This commit introduces a custom deserializer for the `types` attribute of `ObjectList`. On top of handling the deserialization case, the custom deserializer provides better default values compared to the ones of the stock `TypeMeta`. The `TypeMeta` struct has empty strings as default values. However, in the context of `ObjectList`, proper default values should be `v1` and `List` instead. [1] serde-rs/serde#1626 [2] serde-rs/serde#1879 Signed-off-by: Flavio Castelli <[email protected]> * ObjectList: derive the `Clone` trait Ensure `ObjectList` derive the `Clone` trait. Signed-off-by: Flavio Castelli <[email protected]> * chore: fix rustfmt warning Signed-off-by: Flavio Castelli <[email protected]> --------- Signed-off-by: Flavio Castelli <[email protected]>
- Loading branch information