Skip to content

Commit 78eefd0

Browse files
committed
added jackson annotations for interfaces on spring generator
1 parent 24aa32e commit 78eefd0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1+
{{#jackson}}
2+
import com.fasterxml.jackson.annotation.JsonSubTypes;
3+
import com.fasterxml.jackson.annotation.JsonTypeInfo;
4+
{{/jackson}}
15
/**
26
* {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
37
*/
8+
{{#jackson}}
9+
@JsonTypeInfo(
10+
use = JsonTypeInfo.Id.NAME,
11+
include = JsonTypeInfo.As.PROPERTY,
12+
property = "type")
13+
@JsonSubTypes({
14+
{{#subTypes}}
15+
@JsonSubTypes.Type(value = {{classname}}.class, name = "{{classname}}"){{^@last}},{{/@last}}
16+
{{/subTypes}}
17+
})
18+
{{/jackson}}
419
public interface {{{classname}}} {
520
621
}

0 commit comments

Comments
 (0)