-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2902 from swagger-api/ticket-2900
ref #2900 - supports primitives in oneOf, anyOf, allOf schema annotations
- Loading branch information
Showing
4 changed files
with
97 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...agger-core/src/test/java/io/swagger/v3/core/resolving/resources/TestObjectTicket2900.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package io.swagger.v3.core.resolving.resources; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema(name = "SomeDTO") | ||
public class TestObjectTicket2900 { | ||
|
||
@Schema(implementation = MyJsonPrimitive.class) | ||
public GsonJsonPrimitive value; | ||
|
||
@Schema( | ||
description = "Description of value", | ||
oneOf = { String.class, Number.class } | ||
) | ||
public GsonJsonPrimitive valueWithMixIn; | ||
|
||
|
||
public class GsonJsonPrimitive { | ||
private String foo; | ||
public String getFoo(){return foo;} | ||
} | ||
|
||
@Schema( | ||
description = "Description of value", | ||
oneOf = { String.class, Number.class } | ||
) | ||
public class MyJsonPrimitive { | ||
} | ||
|
||
public abstract class GsonJsonPrimitiveMixIn { | ||
@JsonIgnore | ||
public abstract String getFoo(); | ||
} | ||
|
||
} |