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
I have a CRD that has an array property in the spec that defaults to [].
foo:
default: []
items:
properties:
bar:
type: string
required:
- bar
type: object
type: array
I generate my Java classes using the io.fabric8:java-generator-maven-plugin:6.2.0 plugin (with generator-annotations). This results in the following generated code in my custom resource's Spec class:
When I attempt to initiate the spec class, it throws the following exception:
Caused by: java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')
at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:237)
This error disappears when I remove the default: [] property from the array property.
Expect to have an ArrayList to be returned from the function call
Runtime
other (please specify in additional context)
Kubernetes API Server version
other (please specify in additional context)
Environment
macOS
Fabric8 Kubernetes Client Logs
java.lang.ClassCastException: class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')
at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:237)
at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:351)
at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:287)
at io.fabric8.kubernetes.client.utils.Serialization.unmarshal(Serialization.java:272)
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a CRD that has an array property in the spec that defaults to
[]
.I generate my Java classes using the
io.fabric8:java-generator-maven-plugin:6.2.0
plugin (withgenerator-annotations
). This results in the following generated code in my custom resource's Spec class:When I attempt to initiate the spec class, it throws the following exception:
This error disappears when I remove the
default: []
property from the array property.Fabric8 Kubernetes Client version
6.2.0
Steps to reproduce
Run the following code:
Expected behavior
Expect to have an
ArrayList
to be returned from the function callRuntime
other (please specify in additional context)
Kubernetes API Server version
other (please specify in additional context)
Environment
macOS
Fabric8 Kubernetes Client Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: