kube-rs / kopium

Kubernetes OPenapI UnMangler
Apache License 2.0
113 stars 21 forks source link

Generated serde model of apiextensionsv1.JSON does not support empty string value #229

Closed Danil-Grigorev closed 6 months ago

Danil-Grigorev commented 6 months ago

Hi, we faced with this issue while attempting to generate and use CRs for cluster-api types.

Under the hood this .JSON field is just Raw []byte, so it can be an empty string. However kopium treats this as BTreeMap<String, serde_json::Value>. Changing this to serde_json::Value fixes the problem, but it may have a cascade effect on other structures.

CRD definition for the field lacks type: information.

Is it possible to treat such fields as enum, BTreeMap|serde_json::Value?

Edit: All fields which are affected by this have +kubebuilder:validation:Schemaless annotation. Those can have any value in it, and then should have serde_json::Value specified.