(Both class A and B in my example extend SomeInterface)

On Friday, December 15, 2017 at 3:49:24 PM UTC-6, niraj...@data.world wrote:
>
> *Problem*
> In Java, whenever swagger.json is generated for the *Request* object the 
> field definition is a reference to *SomeInterface* instead of a OneOf 
> definition pointing to class *A* or *B*.
>
> *Classes*
> public class Request {
>     private SomeInterface field;
> }
>
> @JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
>     include = JsonTypeInfo.As.PROPERTY,
>     property = "format",
>     visible = true)
> @JsonSubTypes({
>     @JsonSubTypes.Type(value = A.class, name = "A"),
>     @JsonSubTypes.Type(value = B.class, name = "B")})
> @ApiModel
> public interface SomeInterface {
>     Format getFormat();
> }
>
> public class A {
>     ...
> }
>
> public class B {
>     ...
> }
>
> Are there any Java annotations to properly generate a OneOf definition for 
> *Request*?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to