Skip to content

Commit

Permalink
Remove unnecessary @JsonUnwrapped constructor annotation (#26)
Browse files Browse the repository at this point in the history
Follow-up to #22
  • Loading branch information
iamdanfox authored Jul 3, 2018
1 parent 451583d commit 5243f5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class UnionTypeExample {
@JsonUnwrapped private final Union union;

@JsonCreator
private UnionTypeExample(@JsonUnwrapped Union union) {
private UnionTypeExample(Union union) {
Objects.requireNonNull(union, "union must not be null");
this.union = union;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ private static MethodSpec generateConstructor(TypeMapper typeMapper, ClassName u
return MethodSpec.constructorBuilder()
.addModifiers(Modifier.PRIVATE)
.addAnnotation(AnnotationSpec.builder(JsonCreator.class).build())
.addParameter(ParameterSpec.builder(unionClass.nestedClass("Union"), UNION_FIELD_NAME)
.addAnnotation(JsonUnwrapped.class)
.build())
.addParameter(ParameterSpec.builder(unionClass.nestedClass("Union"), UNION_FIELD_NAME).build())
.addStatement(Expressions.requireNonNull(UNION_FIELD_NAME, "union must not be null"))
.addStatement("this.$1L = $1L", UNION_FIELD_NAME)
.build();
Expand Down

0 comments on commit 5243f5e

Please sign in to comment.