Skip to content

Commit

Permalink
[java-vertx] Missing interface handlebars
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyro-Ing authored and Fyro committed Jun 5, 2024
1 parent e34685e commit 0f2ba8e
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/main/resources/handlebars/JavaVertXServer/interface.mustache
Original file line number Diff line number Diff line change
@@ -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}}
}
25 changes: 25 additions & 0 deletions src/test/resources/3_0_0/petstore-vertx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0f2ba8e

Please sign in to comment.