Arnavion / k8s-openapi

Rust definitions of the resource types in the Kubernetes client API
Apache License 2.0
384 stars 41 forks source link

RawExtension is emitted incorrectly #8

Closed Arnavion closed 6 years ago

Arnavion commented 6 years ago

The schema defines RawExtension to be an object with a required raw property that's a byte-format string. So the codegen emits it as struct RawExtension { raw: ByteString }

In reality the schema is wrong. The server-side RawExtension.raw is indeed a []byte, but the contents are the JSON-serialized form of some other value. The RawExtension is serialized to JSON by emitting this serialized form. So RawExtension should be represented by serde_json::Value