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
@@ -87,19 +89,45 @@ public interface {{classname}}{{#vendorExtensions.x-has-child-generic}}<T>{{/ven
87
89
{{/isModel}}
88
90
{{/composedSchemas.oneOf}}
89
91
90
-
class Deserializer{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}} extends JsonDeserializer<{{classname}}{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}}> {
92
+
class Deserializer{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}} extends JsonDeserializer<{{classname}}{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}}>{{#vendorExtensions.x-has-child-generic}} implements ContextualDeserializer{{/vendorExtensions.x-has-child-generic}}{
91
93
92
94
private static final Logger LOGGER = Logger.getLogger(Deserializer.class.getName());
93
95
96
+
{{#vendorExtensions.x-has-child-generic}}
97
+
private JavaType returnType;
98
+
99
+
public Deserializer() {}
100
+
101
+
private Deserializer(JavaType returnType) {
102
+
this.returnType = returnType;
103
+
}
104
+
105
+
@Override
106
+
public JsonDeserializer<?> createContextual(DeserializationContext ctxt, BeanProperty property) {
public {{classname}}{{#vendorExtensions.x-has-child-generic}}<T>{{/vendorExtensions.x-has-child-generic}} deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
96
114
JsonNode tree = jp.readValueAsTree();
97
115
{{#composedSchemas.oneOf}}
98
116
// deserialize {{{datatypeWithEnum}}}
99
117
if (tree.{{#isModel}}isObject(){{#vendorExtensions.x-discriminator-fields}} && tree.has("{{{.}}}"){{/vendorExtensions.x-discriminator-fields}}{{/isModel}}{{#isEnumRef}}isTextual(){{/isEnumRef}}{{#isArray}}isArray(){{/isArray}}{{#isInteger}}isInt(){{/isInteger}}{{#isLong}}isLong(){{/isLong}}{{#isDouble}}isDouble(){{/isDouble}}{{#isBoolean}}isBoolean(){{/isBoolean}}{{#isString}}isTextual(){{/isString}}{{^isEnumRef}}{{^isModel}}{{^isArray}}{{^isInteger}}{{^isLong}}{{^isDouble}}{{^isBoolean}}{{^isString}}isObject(){{/isString}}{{/isBoolean}}{{/isDouble}}{{/isLong}}{{/isInteger}}{{/isArray}}{{/isModel}}{{/isEnumRef}}){
0 commit comments