Arnavion / k8s-openapi

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

Fix any type #106

Closed kitagry closed 2 years ago

kitagry commented 2 years ago

Hi @Arnavion , Thank you for the nice library.

I would use this library to create custom resource definition. And, I got the following error.

* spec.validation.openAPIV3Schema.properties[spec].properties[jobTemplate].properties[spec].properties[template].propert
ies[spec].properties[volumes].items.properties[ephemeral].properties[volumeClaimTemplate].properties[metadata].propertie
s[managedFields].items.properties[fieldsV1].type: Required value: must not be empty for specified object fields

It is because the fieldsV1 which is any type returns no type. I confirmed k8s swagger that its type is "object". And, I fix it.

Please, feel free to close this PR. Thank you!

Arnavion commented 2 years ago

Yes, you are correct. swagger20::Type::parse maps { "type": "object" } to Type::Any, so the JsonSchema impl needs to do the reverse. Thanks.