|
|
|
|
@@ -11,6 +11,7 @@ import java.util.Set;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameters;
|
|
|
|
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
|
|
|
|
import io.swagger.v3.oas.annotations.media.Content;
|
|
|
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
|
|
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
|
|
|
@@ -120,8 +121,8 @@ public interface PetApi {
|
|
|
|
|
tags = { "pet" },
|
|
|
|
|
responses = {
|
|
|
|
|
@ApiResponse(responseCode = "200", description = "successful operation", content = {
|
|
|
|
|
@Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)),
|
|
|
|
|
@Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))
|
|
|
|
|
@Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))),
|
|
|
|
|
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class)))
|
|
|
|
|
}),
|
|
|
|
|
@ApiResponse(responseCode = "400", description = "Invalid status value")
|
|
|
|
|
},
|
|
|
|
|
@@ -140,12 +141,12 @@ public interface PetApi {
|
|
|
|
|
getRequest().ifPresent(request -> {
|
|
|
|
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
|
|
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
|
|
|
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
|
|
|
|
|
String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]";
|
|
|
|
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
|
|
|
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
|
|
|
|
String exampleString = "<Pet> <id>123456789</id> <Category> <id>123456789</id> <name>aeiou</name> </Category> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> <Tag> <id>123456789</id> <name>aeiou</name> </Tag> </tags> <status>aeiou</status> </Pet>";
|
|
|
|
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
@@ -173,8 +174,8 @@ public interface PetApi {
|
|
|
|
|
tags = { "pet" },
|
|
|
|
|
responses = {
|
|
|
|
|
@ApiResponse(responseCode = "200", description = "successful operation", content = {
|
|
|
|
|
@Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)),
|
|
|
|
|
@Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class))
|
|
|
|
|
@Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))),
|
|
|
|
|
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class)))
|
|
|
|
|
}),
|
|
|
|
|
@ApiResponse(responseCode = "400", description = "Invalid tag value")
|
|
|
|
|
},
|
|
|
|
|
@@ -193,12 +194,12 @@ public interface PetApi {
|
|
|
|
|
getRequest().ifPresent(request -> {
|
|
|
|
|
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
|
|
|
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
|
|
|
|
String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
|
|
|
|
|
String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]";
|
|
|
|
|
ApiUtil.setExampleResponse(request, "application/json", exampleString);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
|
|
|
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
|
|
|
|
String exampleString = "<Pet> <id>123456789</id> <Category> <id>123456789</id> <name>aeiou</name> </Category> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> <Tag> <id>123456789</id> <name>aeiou</name> </Tag> </tags> <status>aeiou</status> </Pet>";
|
|
|
|
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
@@ -251,7 +252,7 @@ public interface PetApi {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
|
|
|
|
|
String exampleString = "<Pet> <id>123456789</id> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> </tags> <status>aeiou</status> </Pet>";
|
|
|
|
|
String exampleString = "<Pet> <id>123456789</id> <Category> <id>123456789</id> <name>aeiou</name> </Category> <name>doggie</name> <photoUrls> <photoUrls>aeiou</photoUrls> </photoUrls> <tags> <Tag> <id>123456789</id> <name>aeiou</name> </Tag> </tags> <status>aeiou</status> </Pet>";
|
|
|
|
|
ApiUtil.setExampleResponse(request, "application/xml", exampleString);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|