diff --git a/src/main/resources/handlebars/JavaVertXServer/interface.mustache b/src/main/resources/handlebars/JavaVertXServer/interface.mustache new file mode 100644 index 0000000000..0d08bbe545 --- /dev/null +++ b/src/main/resources/handlebars/JavaVertXServer/interface.mustache @@ -0,0 +1,26 @@ +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +{{/jackson}} +/** +* {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} +*/ +{{#jackson}} +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "type") +@JsonSubTypes({ + {{#subTypes}} + @JsonSubTypes.Type(value = {{classname}}.class, name = "{{classname}}"){{^@last}},{{/@last}} + {{/subTypes}} +}) +{{/jackson}} +public interface {{{classname}}} { + +{{#vendorExtensions}} +{{#x-discriminator-type-getter}} + {{x-discriminator-type}} {{x-discriminator-type-getter}}(); +{{/x-discriminator-type-getter}} +{{/vendorExtensions}} +} diff --git a/src/test/resources/3_0_0/petstore-vertx.yaml b/src/test/resources/3_0_0/petstore-vertx.yaml index 73ffa78fbc..9fc20545e6 100644 --- a/src/test/resources/3_0_0/petstore-vertx.yaml +++ b/src/test/resources/3_0_0/petstore-vertx.yaml @@ -745,8 +745,33 @@ components: - available - pending - sold + part: + type: array + items: + oneOf: + - $ref: "#/components/schemas/Dog" + - $ref: "#/components/schemas/Cat" xml: name: Pet + Dog: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + bark: + type: boolean + breed: + type: string + enum: [Dingo, Husky, Retriever, Shepherd] + Cat: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + hunts: + type: boolean + age: + type: integer ApiResponse: type: object properties: