-
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 siblings in response and request body schemas OAS 3.1 resolving
- Loading branch information
Showing
4 changed files
with
265 additions
and
4 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
58 changes: 58 additions & 0 deletions
58
...rs2/src/test/java/io/swagger/v3/jaxrs2/resources/SiblingsResourceRequestBodyMultiple.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,58 @@ | ||
package io.swagger.v3.jaxrs2.resources; | ||
|
||
import io.swagger.v3.jaxrs2.resources.siblings.PetSimple; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.parameters.RequestBody; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.core.Response; | ||
|
||
@Path("/test") | ||
public class SiblingsResourceRequestBodyMultiple { | ||
@Path("/bodyimpl") | ||
@GET | ||
@Operation( | ||
requestBody = | ||
@RequestBody( | ||
description = "aaa", | ||
content = { | ||
@Content( | ||
mediaType = "application/json", | ||
schema = @Schema( | ||
description = "resource pet", | ||
implementation = PetSimple.class, | ||
accessMode = Schema.AccessMode.WRITE_ONLY)), | ||
@Content( | ||
mediaType = "application/xml", | ||
schema = @Schema( | ||
description = "resource pet xml", | ||
implementation = PetSimple.class, | ||
accessMode = Schema.AccessMode.WRITE_ONLY)) | ||
})) | ||
public Response getBodyImpl(Object body) { | ||
return null; | ||
} | ||
|
||
@Path("/bodyimplparam") | ||
@GET | ||
public Response getBodyImplParam(@RequestBody( | ||
content = { | ||
@Content( | ||
mediaType = "application/json", | ||
schema = @Schema( | ||
description = "resource pet", | ||
implementation = PetSimple.class, | ||
accessMode = Schema.AccessMode.WRITE_ONLY)), | ||
@Content( | ||
mediaType = "application/xml", | ||
schema = @Schema( | ||
description = "resource pet xml", | ||
implementation = PetSimple.class, | ||
accessMode = Schema.AccessMode.WRITE_ONLY)) | ||
}) Object body) { | ||
return null; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...swagger-jaxrs2/src/test/java/io/swagger/v3/jaxrs2/resources/SiblingsResourceResponse.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,62 @@ | ||
package io.swagger.v3.jaxrs2.resources; | ||
|
||
import io.swagger.v3.jaxrs2.resources.siblings.PetSimple; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
|
||
@Path("/test") | ||
public class SiblingsResourceResponse { | ||
@GET | ||
@Operation( | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "300", | ||
description = "aaa", | ||
useReturnTypeSchema = true, | ||
content = { | ||
@Content( | ||
mediaType = "application/json", | ||
schema = @Schema( | ||
description = "resource pet", | ||
accessMode = Schema.AccessMode.READ_ONLY)), | ||
@Content( | ||
mediaType = "application/xml", | ||
schema = @Schema( | ||
description = "resource pet xml", | ||
accessMode = Schema.AccessMode.READ_ONLY)) | ||
})}) | ||
public PetSimple getCart() { | ||
return null; | ||
} | ||
|
||
@Path("/impl") | ||
@GET | ||
@Operation( | ||
responses = { | ||
@ApiResponse( | ||
responseCode = "300", | ||
description = "aaa", | ||
content = { | ||
@Content( | ||
mediaType = "application/json", | ||
schema = @Schema( | ||
description = "resource pet", | ||
implementation = PetSimple.class, | ||
accessMode = Schema.AccessMode.READ_ONLY)), | ||
@Content( | ||
mediaType = "application/xml", | ||
schema = @Schema( | ||
description = "resource pet xml", | ||
implementation = PetSimple.class, | ||
accessMode = Schema.AccessMode.READ_ONLY)) | ||
})}) | ||
public PetSimple getCartImpl() { | ||
return null; | ||
} | ||
|
||
} |