In my project im using a value objects eg:
@Getter
@ToString
@Embeddable
@NoArgsConstructor(access = AccessLevel.PROTECTED, force = true)
@RequiredArgsConstructor(staticName = "of")
@EqualsAndHashCode
public class EmailAddress {
private final String value;
public static String getValue(EmailAddress object) {
if(object == null)
return null;
return object.value;
}
}
Now I want tu use it in my api but I don’t want have nasted objects in schema.
How can I configure JSON ? Have I write own serializer and deserializer ? What is the simpliest solution ?