You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor issue when using the fully automatic schemas against something using IntOrString:
error[E0277]: the trait bound `IntOrString: JsonSchema` is not satisfied
--> tests/./gen.rs:15:15
|
15 | pub port: IntOrString,
| ^^^^^^^^^^^ the trait `JsonSchema` is not implemented for `IntOrString`
|
note: required by a bound in `SchemaGenerator::subschema_for`
--> /home/clux/.cargo/registry/src/github.com-1ecc6299db9ec823/schemars-0.8.8/src/gen.rs:218:38
|
218 | pub fn subschema_for<T: ?Sized + JsonSchema>(&mut self) -> Schema {
| ^^^^^^^^^^ required by this bound in `SchemaGenerator::subschema_for`
error[E0277]: the trait bound `IntOrString: JsonSchema` is not satisfied
--> tests/./gen.rs:7:64
|
7 | #[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema)]
| ^^^^^^^^^^ the trait `JsonSchema` is not implemented for `IntOrString`
|
= note: this error originates in the derive macro `JsonSchema` (in Nightly builds, run with -Z macro-backtrace for more info)
some potential solutions:
get an impl in k8s-openapi
inline IntOrString with JsonSchema derive (awkward, but avoids user dep on k8s-openapi in some cases perhaps)
This isn't a big deal because it's only the schema part, we can still generate the structs.
Workaround is not use -A or --schema=derived with such schemas, but use --schema=manual or the default and read the schema from a file if needed (if you need to overwrite the crd at some point).
The text was updated successfully, but these errors were encountered:
Minor issue when using the fully automatic schemas against something using
IntOrString
:some potential solutions:
IntOrString
with JsonSchema derive (awkward, but avoids user dep on k8s-openapi in some cases perhaps)This isn't a big deal because it's only the schema part, we can still generate the structs.
Workaround is not use
-A
or--schema=derived
with such schemas, but use--schema=manual
or the default and read the schema from a file if needed (if you need to overwrite the crd at some point).The text was updated successfully, but these errors were encountered: