We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you use the Serialization util to create yaml from an object that uses JsonSubTypes and JsonTypeInfo, the result will not be valid yaml:
package org.acme; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import io.fabric8.kubernetes.client.utils.Serialization; public class Root { @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type" ) @JsonSubTypes( @JsonSubTypes.Type(value = Typed.class, name = "x") ) public interface Typeable { String getType(); } public static class Typed implements Typeable { @Override public String getType() { return "x"; } } private Typeable typeable; public Typeable getTypeable() { return typeable; } public void setTypeable(Typeable typeable) { this.typeable = typeable; } public static void main(String[] args) { Root root = new Root(); root.setTypeable(new Typed()); System.out.println(Serialization.asYaml(root)); } }
prints
--- typeable: !<x> type: "x"
This is covered in https://stackoverflow.com/questions/40272165/jackson-yaml-type-info-is-wrong-on-serialization and seems to require disabling a feature on the YAMLFactory.
The text was updated successfully, but these errors were encountered:
fix for fabric8io#2989 disable the native type id feature for yaml
30975c9
8da1d0f
fix for #2989 disable the native type id feature for yaml
a9e082c
Was this issue fixed by #2990 ? can we close it?
Sorry, something went wrong.
Yes it was fixed and can be closed.
No branches or pull requests
If you use the Serialization util to create yaml from an object that uses JsonSubTypes and JsonTypeInfo, the result will not be valid yaml:
prints
This is covered in https://stackoverflow.com/questions/40272165/jackson-yaml-type-info-is-wrong-on-serialization and seems to require disabling a feature on the YAMLFactory.
The text was updated successfully, but these errors were encountered: