From 3834a6035c23c6fd3715e9616dfdfbd9e75a974c Mon Sep 17 00:00:00 2001 From: lokeshnaik808 Date: Tue, 29 Apr 2025 00:01:55 +0200 Subject: [PATCH] Update interface.mustache to use discriminator value than default 'type' This change will enable Code Generator to generate Interfaces with Jackson JsonTypeInfo corresponding to the discriminator object name defined for oneOf type variable in Swagger, instead of having default value 'type'. --- src/main/resources/handlebars/JavaSpring/interface.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/handlebars/JavaSpring/interface.mustache b/src/main/resources/handlebars/JavaSpring/interface.mustache index 0d08bbe545..2c8584ac81 100644 --- a/src/main/resources/handlebars/JavaSpring/interface.mustache +++ b/src/main/resources/handlebars/JavaSpring/interface.mustache @@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, - property = "type") + property = "{{discriminator.propertyName}}") @JsonSubTypes({ {{#subTypes}} @JsonSubTypes.Type(value = {{classname}}.class, name = "{{classname}}"){{^@last}},{{/@last}}