-
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 #3921 from swagger-api/ticket-3920
- Loading branch information
Showing
13 changed files
with
133 additions
and
35 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
48 changes: 48 additions & 0 deletions
48
modules/swagger-core/src/test/java/io/swagger/v3/core/resolving/Ticket2884Test.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,48 @@ | ||
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.Ticket2884Model; | ||
import io.swagger.v3.core.resolving.resources.Ticket2884ModelClass; | ||
import io.swagger.v3.oas.models.media.Schema; | ||
import org.testng.annotations.Test; | ||
|
||
public class Ticket2884Test extends SwaggerTestBase { | ||
@Test | ||
public void test2884() throws Exception { | ||
final ModelResolver modelResolver = new ModelResolver(mapper()); | ||
|
||
ModelConverterContextImpl context = new ModelConverterContextImpl(modelResolver); | ||
|
||
Ticket2884ModelClass a = new Ticket2884ModelClass(); | ||
|
||
Schema model = context | ||
.resolve(new AnnotatedType(Ticket2884Model.class)); | ||
|
||
SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "Ticket2884Model:\n" + | ||
" type: object\n" + | ||
" properties:\n" + | ||
" Ticket2884Model:\n" + | ||
" type: object"); | ||
|
||
context = new ModelConverterContextImpl(modelResolver); | ||
model = context | ||
.resolve(new AnnotatedType(Ticket2884ModelClass.class)); | ||
|
||
SerializationMatchers.assertEqualsToYaml(context.getDefinedModels(), "Ticket2884ModelClass:\n" + | ||
" type: object\n" + | ||
" properties:\n" + | ||
" Ticket2884ModelClass:\n" + | ||
" type: object\n" + | ||
" properties:\n" + | ||
" bar:\n" + | ||
" type: string\n" + | ||
" foo:\n" + | ||
" type: array\n" + | ||
" items:\n" + | ||
" type: string\n"); | ||
} | ||
|
||
} |
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
6 changes: 6 additions & 0 deletions
6
...es/swagger-core/src/test/java/io/swagger/v3/core/resolving/resources/Ticket2884Model.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,6 @@ | ||
package io.swagger.v3.core.resolving.resources; | ||
|
||
@com.fasterxml.jackson.annotation.JsonTypeInfo( | ||
use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, | ||
include = com.fasterxml.jackson.annotation.JsonTypeInfo.As.WRAPPER_OBJECT) | ||
public interface Ticket2884Model {} |
13 changes: 13 additions & 0 deletions
13
...agger-core/src/test/java/io/swagger/v3/core/resolving/resources/Ticket2884ModelClass.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,13 @@ | ||
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) | ||
public class Ticket2884ModelClass { | ||
|
||
public String bar; | ||
public List<String> foo; | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
version=2.1.8-SNAPSHOT | ||
jettyVersion=9.4.35.v20201120 | ||
jettyVersion=9.4.39.v20210325 |
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
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