When MarshalJSON objectMeta, for CreationTimestamp the json method is
// MarshalJSON implements the json.Marshaler interface.
func (t Time) MarshalJSON() ([]byte, error) {
if t.IsZero() {
// Encode unset/nil objects as JSON's "null".
return []byte("null"), nil
}
return json.Marshal(t.UTC().Format(time.RFC3339))
}
it convert time struct to a string ,like
''creationTimestamp":"2017-12-26T09:12:42Z"
But in java ,we just convert to a struct like
"creationTimestamp": {
"Time": "2017-12-26T09:12:42Z"
},"
when we UnmarshalJSON from java data to go data ,an error happen ,the error is
[]string: CreationTimestamp: unmarshalerDecoder: parsing time "" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "2006", parsing 125 ...9:12:42Z"}...
So, we suggest to change java method
/**
*
*
* @return
* The creationTimestamp
*/
@JsonProperty("creationTimestamp")
public Time getCreationTimestamp() {
return creationTimestamp;
}
in ObjectMeta class ,change to
/**
*
*
* @return
* The creationTimestamp
*/
@JsonProperty("creationTimestamp")
public string getCreationTimestamp() {
return new mapper().writeValueAsString(creationTimestamp);
}