-
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.
fix #4316 - additionalProperties and ArraySchema.implementation proce…
…ssing
- Loading branch information
Showing
5 changed files
with
151 additions
and
15 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
23 changes: 23 additions & 0 deletions
23
...axrs2/src/test/java/io/swagger/v3/jaxrs2/resources/ArraySchemaImplementationResource.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,23 @@ | ||
package io.swagger.v3.jaxrs2.resources; | ||
|
||
import io.swagger.v3.oas.annotations.media.ArraySchema; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import java.util.List; | ||
|
||
public class ArraySchemaImplementationResource { | ||
|
||
static class Pet { | ||
@ArraySchema(schema = @Schema(implementation = Integer.class, description = "A house in a street")) | ||
public List<Number> cars; | ||
} | ||
|
||
@GET | ||
@Path("/test") | ||
public Pet test() { | ||
return null; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
...c/test/java/io/swagger/v3/jaxrs2/resources/SchemaAdditionalPropertiesBooleanResource.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.jaxrs2.resources; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
|
||
|
||
public class SchemaAdditionalPropertiesBooleanResource { | ||
|
||
@Schema(additionalProperties = Schema.AdditionalPropertiesValue.FALSE) | ||
static class Pet { | ||
@Schema(additionalPropertiesSchema = Bar.class) | ||
public Bar bar; | ||
|
||
@Schema(additionalProperties = Schema.AdditionalPropertiesValue.FALSE) | ||
public Bar vbar; | ||
} | ||
|
||
|
||
static class Bar { | ||
public String foo; | ||
} | ||
|
||
@Schema(description = "A car") | ||
static class Car { | ||
public String foo; | ||
} | ||
|
||
@GET | ||
@Path("/test") | ||
public Pet test() { | ||
return null; | ||
} | ||
|
||
} |