-
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.
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 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
32 changes: 32 additions & 0 deletions
32
modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket3699Test.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,32 @@ | ||
package io.swagger.v3.core.resolving; | ||
|
||
import io.swagger.v3.core.converter.AnnotatedType; | ||
import io.swagger.v3.core.converter.ModelConverterContextImpl; | ||
import io.swagger.v3.core.jackson.ModelResolver; | ||
import io.swagger.v3.core.matchers.SerializationMatchers; | ||
import io.swagger.v3.core.resolving.resources.TestObject3699; | ||
import org.testng.annotations.Test; | ||
|
||
public class Ticket3699Test extends SwaggerTestBase { | ||
|
||
@Test | ||
public void test3699() { | ||
final ModelResolver modelResolver = new ModelResolver(mapper()); | ||
|
||
ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver); | ||
context.resolve(new AnnotatedType(TestObject3699.class)); | ||
|
||
SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "TestObject3699:\n" + | ||
" type: object\n" + | ||
" properties:\n" + | ||
" CustomName:\n" + | ||
" type: object\n" + | ||
" properties:\n" + | ||
" bar:\n" + | ||
" type: string\n" + | ||
" foo:\n" + | ||
" type: array\n" + | ||
" items:\n" + | ||
" type: string\n"); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...les/swagger-core/src/test/java/io/swagger/v3/core/resolving/resources/TestObject3699.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,12 @@ | ||
package io.swagger.v3.core.resolving.resources; | ||
|
||
import java.util.List; | ||
|
||
@com.fasterxml.jackson.annotation.JsonTypeInfo( | ||
use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, | ||
include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.WRAPPER_OBJECT) | ||
@com.fasterxml.jackson.annotation.JsonTypeName("CustomName") | ||
public class TestObject3699 { | ||
public String bar; | ||
public List<String> foo; | ||
} |