forked from loafle/openapi-generator-original
parent
da96058f5b
commit
1f23b019fa
@ -244,20 +244,20 @@ public interface {{classname}} {
|
||||
{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
|
||||
{{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
|
||||
{{/hasParams}}{{#swagger2AnnotationLibrary}}@Parameter(hidden = true){{/swagger2AnnotationLibrary}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}},
|
||||
{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}{{#springDocDocumentationProvider}}@ParameterObject {{/springDocDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}
|
||||
{{/hasParams}}{{^hasParams}}{{#reactive}},{{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}{{#springDocDocumentationProvider}}@ParameterObject {{/springDocDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}
|
||||
){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
|
||||
{{#delegate-method}}
|
||||
{{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}});
|
||||
{{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}pageable{{/vendorExtensions.x-spring-paginated}});
|
||||
}
|
||||
|
||||
// Override this method
|
||||
{{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, {{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} {
|
||||
{{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} {
|
||||
{{/delegate-method}}
|
||||
{{^isDelegate}}
|
||||
{{>methodBody}}
|
||||
{{/isDelegate}}
|
||||
{{#isDelegate}}
|
||||
{{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}});
|
||||
{{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}pageable{{/vendorExtensions.x-spring-paginated}});
|
||||
{{/isDelegate}}
|
||||
}{{/jdk8-default-interface}}
|
||||
|
||||
|
@ -122,7 +122,7 @@ public class {{classname}}Controller implements {{classname}} {
|
||||
public {{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}(
|
||||
{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},
|
||||
{{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}},
|
||||
{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}
|
||||
{{/hasParams}}{{^hasParams}}{{#reactive}},{{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore {{/springFoxDocumentationProvider}}{{#springDocDocumentationProvider}}@ParameterObject {{/springDocDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}
|
||||
) {
|
||||
{{^isDelegate}}
|
||||
{{^async}}
|
||||
@ -138,7 +138,7 @@ public class {{classname}}Controller implements {{classname}} {
|
||||
{{/async}}
|
||||
{{/isDelegate}}
|
||||
{{#isDelegate}}
|
||||
{{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}delegate.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}});
|
||||
{{^isVoid}}return {{/isVoid}}{{#isVoid}}{{#useResponseEntity}}return {{/useResponseEntity}}{{^useResponseEntity}}{{#reactive}}return {{/reactive}}{{/useResponseEntity}}{{/isVoid}}delegate.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}pageable{{/vendorExtensions.x-spring-paginated}});
|
||||
{{/isDelegate}}
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ public interface {{classname}}Delegate {
|
||||
{{/isDeprecated}}
|
||||
{{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux<Part>{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}},
|
||||
{{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}},
|
||||
{{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
|
||||
{{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} {
|
||||
{{>methodBody}}
|
||||
}{{/jdk8-default-interface}}
|
||||
|
||||
|
@ -868,8 +868,7 @@ public class SpringCodegenTest {
|
||||
Map<String, File> files = generator.opts(input).generate().stream()
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("PersonWithEmail.java"))
|
||||
.printFileContent();
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("PersonWithEmail.java"));
|
||||
if (useBeanValidation) javaFileAssert.hasImports((useJakarta? "jakarta" : "javax") + ".validation.constraints");
|
||||
if (performBeanValidation) javaFileAssert.hasImports("org.hibernate.validator.constraints");
|
||||
assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java"), contains);
|
||||
@ -946,6 +945,71 @@ public class SpringCodegenTest {
|
||||
.assertMethod("readAgreements", "ServerWebExchange");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldGenerateValidCodeWithPaginated_reactive_issue15265() throws IOException {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
output.deleteOnExit();
|
||||
|
||||
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/bugs/issue_15265.yaml");
|
||||
final SpringCodegen codegen = new SpringCodegen();
|
||||
codegen.setOpenAPI(openAPI);
|
||||
codegen.setOutputDir(output.getAbsolutePath());
|
||||
|
||||
codegen.additionalProperties().put(SpringCodegen.REACTIVE, "true");
|
||||
codegen.additionalProperties().put(USE_TAGS, "true");
|
||||
codegen.additionalProperties().put(SpringCodegen.DATE_LIBRARY, "java8");
|
||||
codegen.additionalProperties().put(INTERFACE_ONLY, "true");
|
||||
codegen.additionalProperties().put(SKIP_DEFAULT_INTERFACE, "true");
|
||||
codegen.additionalProperties().put(IMPLICIT_HEADERS, "true");
|
||||
codegen.additionalProperties().put(OPENAPI_NULLABLE, "false");
|
||||
|
||||
ClientOptInput input = new ClientOptInput();
|
||||
input.openAPI(openAPI);
|
||||
input.config(codegen);
|
||||
|
||||
DefaultGenerator generator = new DefaultGenerator();
|
||||
|
||||
Map<String, File> files = generator.opts(input).generate().stream()
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert.assertThat(files.get("ConsentControllerApi.java"))
|
||||
.assertMethod("paginated", "ServerWebExchange", "Pageable")
|
||||
.toFileAssert()
|
||||
.assertMethod("paginatedWithParams", "String", "ServerWebExchange", "Pageable");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldGenerateValidCodeWithPaginated_nonReactive_issue15265() throws IOException {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
output.deleteOnExit();
|
||||
|
||||
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/bugs/issue_15265.yaml");
|
||||
final SpringCodegen codegen = new SpringCodegen();
|
||||
codegen.setOpenAPI(openAPI);
|
||||
codegen.setOutputDir(output.getAbsolutePath());
|
||||
|
||||
codegen.additionalProperties().put(USE_TAGS, "true");
|
||||
codegen.additionalProperties().put(SpringCodegen.DATE_LIBRARY, "java8");
|
||||
codegen.additionalProperties().put(INTERFACE_ONLY, "true");
|
||||
codegen.additionalProperties().put(SKIP_DEFAULT_INTERFACE, "true");
|
||||
codegen.additionalProperties().put(IMPLICIT_HEADERS, "true");
|
||||
codegen.additionalProperties().put(OPENAPI_NULLABLE, "false");
|
||||
|
||||
ClientOptInput input = new ClientOptInput();
|
||||
input.openAPI(openAPI);
|
||||
input.config(codegen);
|
||||
|
||||
DefaultGenerator generator = new DefaultGenerator();
|
||||
|
||||
Map<String, File> files = generator.opts(input).generate().stream()
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert.assertThat(files.get("ConsentControllerApi.java"))
|
||||
.assertMethod("paginated", "Pageable")
|
||||
.toFileAssert()
|
||||
.assertMethod("paginatedWithParams", "String", "Pageable");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldEscapeReservedKeyWordsForRequestParameters_7506_Regression() throws Exception {
|
||||
final SpringCodegen codegen = new SpringCodegen();
|
||||
@ -1483,7 +1547,6 @@ public class SpringCodegenTest {
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert.assertThat(files.get("PetApi.java"))
|
||||
.printFileContent()
|
||||
.hasImports("io.swagger.v3.oas.annotations.ExternalDocumentation")
|
||||
.assertMethod("updatePet")
|
||||
.assertMethodAnnotations()
|
||||
@ -1831,7 +1894,6 @@ public class SpringCodegenTest {
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert.assertThat(files.get("SomeMethodApi.java"))
|
||||
.printFileContent()
|
||||
.assertMethod("methodWithValidation")
|
||||
.hasParameter("headerOne")
|
||||
.assertParameterAnnotations()
|
||||
@ -1872,8 +1934,7 @@ public class SpringCodegenTest {
|
||||
Map<String, File> files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml");
|
||||
|
||||
//Assert that NotNull annotation exists alone with no other BeanValidation annotations
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Person.java"))
|
||||
.printFileContent();
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Person.java"));
|
||||
javaFileAssert.assertMethod("getName").assertMethodAnnotations()
|
||||
.containsWithName("NotNull").anyMatch(annotation ->
|
||||
!annotation.getNameAsString().equals("Valid") ||
|
||||
@ -1904,8 +1965,7 @@ public class SpringCodegenTest {
|
||||
Map<String, File> files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml");
|
||||
|
||||
//Assert that NotNull annotation exists alone with no other BeanValidation annotations
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Person.java"))
|
||||
.printFileContent();
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Person.java"));
|
||||
javaFileAssert.assertMethod("getName").assertMethodAnnotations()
|
||||
.containsWithName("NotNull").anyMatch(annotation ->
|
||||
!annotation.getNameAsString().equals("Valid") ||
|
||||
@ -1933,8 +1993,7 @@ public class SpringCodegenTest {
|
||||
|
||||
Map<String, File> files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml");
|
||||
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Alien.java"))
|
||||
.printFileContent();
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Alien.java"));
|
||||
javaFileAssert.assertMethod("getName")
|
||||
.assertMethodAnnotations().anyMatch(annotation -> !annotation.getNameAsString().equals("NotNull"));
|
||||
javaFileAssert.hasNoImports("javax.validation.constraints.NotNull");
|
||||
@ -1950,7 +2009,6 @@ public class SpringCodegenTest {
|
||||
Map<String, File> files = generateFiles(codegen, "src/test/resources/bugs/issue_14252.yaml");
|
||||
|
||||
JavaFileAssert.assertThat(files.get("MyResponse.java"))
|
||||
.printFileContent()
|
||||
.hasImports("com.fasterxml.jackson.databind.annotation.JsonSerialize", "com.fasterxml.jackson.databind.ser.std.ToStringSerializer")
|
||||
.assertMethod("getMyPropTypeNumber")
|
||||
.assertMethodAnnotations()
|
||||
@ -1977,8 +2035,7 @@ public class SpringCodegenTest {
|
||||
|
||||
Map<String, File> files = generateFiles(codegen, "src/test/resources/bugs/issue_13365.yml");
|
||||
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Person.java"))
|
||||
.printFileContent();
|
||||
JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("Person.java"));
|
||||
javaFileAssert.assertMethod("getName").assertMethodAnnotations()
|
||||
.containsWithName("NotNull").containsWithName("Size").containsWithName("javax.validation.constraints.Email");
|
||||
javaFileAssert
|
||||
@ -2010,7 +2067,6 @@ public class SpringCodegenTest {
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert.assertThat(files.get("TestObject.java"))
|
||||
.printFileContent()
|
||||
.assertMethod("equals")
|
||||
.bodyContainsLines("return equalsNullable(this.picture, testObject.picture);");
|
||||
|
||||
@ -2041,7 +2097,6 @@ public class SpringCodegenTest {
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert.assertThat(files.get("TestObject.java"))
|
||||
.printFileContent()
|
||||
.assertMethod("equals")
|
||||
.bodyContainsLines("return Arrays.equals(this.picture, testObject.picture);");
|
||||
}
|
||||
@ -2071,7 +2126,6 @@ public class SpringCodegenTest {
|
||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||
|
||||
JavaFileAssert.assertThat(files.get("AddApi.java"))
|
||||
.printFileContent()
|
||||
.assertMethod("addPost")
|
||||
.hasParameter("body")
|
||||
.assertParameterAnnotations()
|
||||
|
@ -124,6 +124,34 @@ paths:
|
||||
- write:pets
|
||||
- read:pets
|
||||
x-spring-paginated: true
|
||||
/pet/all:
|
||||
get:
|
||||
tags:
|
||||
- pet
|
||||
summary: List all pets
|
||||
operationId: listAllPets
|
||||
responses:
|
||||
200:
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
400:
|
||||
description: Invalid status value
|
||||
content: { }
|
||||
security:
|
||||
- petstore_auth:
|
||||
- write:pets
|
||||
- read:pets
|
||||
x-spring-paginated: true
|
||||
/pet/findByTags:
|
||||
get:
|
||||
tags:
|
||||
|
@ -0,0 +1,55 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: TEST
|
||||
description: |-
|
||||
## TEST
|
||||
version: 1.0.0
|
||||
|
||||
servers:
|
||||
- url: /v3
|
||||
description: Major version of service
|
||||
|
||||
tags:
|
||||
- name: consent-controller
|
||||
description: Consent API
|
||||
|
||||
|
||||
paths:
|
||||
/paginated-with-params:
|
||||
get:
|
||||
tags:
|
||||
- consent-controller
|
||||
operationId: paginatedWithParams
|
||||
x-spring-paginated: true
|
||||
parameters:
|
||||
- in: query
|
||||
name: param1
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ResponseAgreement'
|
||||
/paginated:
|
||||
get:
|
||||
tags:
|
||||
- consent-controller
|
||||
operationId: paginated
|
||||
x-spring-paginated: true
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ResponseAgreement'
|
||||
components:
|
||||
schemas:
|
||||
ResponseAgreement:
|
||||
type: object
|
||||
properties:
|
||||
agreementId:
|
||||
type: string
|
@ -217,6 +217,42 @@ public interface PetApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GET /pet/all : List all pets
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid status value (status code 400)
|
||||
*/
|
||||
@ApiOperation(
|
||||
tags = { "pet" },
|
||||
value = "List all pets",
|
||||
nickname = "listAllPets",
|
||||
notes = "",
|
||||
response = Pet.class,
|
||||
responseContainer = "List",
|
||||
authorizations = {
|
||||
@Authorization(value = "petstore_auth", scopes = {
|
||||
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}
|
||||
)
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
@ApiResponse(code = 400, message = "Invalid status value")
|
||||
})
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/pet/all",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
default ResponseEntity<List<Pet>> listAllPets(
|
||||
@ApiIgnore final Pageable pageable
|
||||
) {
|
||||
return getDelegate().listAllPets(pageable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet
|
||||
*
|
||||
|
@ -141,6 +141,32 @@ public interface PetApiDelegate {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /pet/all : List all pets
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid status value (status code 400)
|
||||
* @see PetApi#listAllPets
|
||||
*/
|
||||
default ResponseEntity<List<Pet>> listAllPets(final Pageable pageable) {
|
||||
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\" }, { \"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> <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;
|
||||
}
|
||||
}
|
||||
});
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet
|
||||
*
|
||||
|
@ -135,6 +135,37 @@ paths:
|
||||
x-accepts: application/json
|
||||
x-tags:
|
||||
- tag: pet
|
||||
/pet/all:
|
||||
get:
|
||||
operationId: listAllPets
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
type: array
|
||||
application/json:
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
type: array
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid status value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- write:pets
|
||||
- read:pets
|
||||
summary: List all pets
|
||||
tags:
|
||||
- pet
|
||||
x-spring-paginated: true
|
||||
x-accepts: application/json
|
||||
x-tags:
|
||||
- tag: pet
|
||||
/pet/findByTags:
|
||||
get:
|
||||
deprecated: true
|
||||
|
@ -217,6 +217,42 @@ public interface PetApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GET /pet/all : List all pets
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid status value (status code 400)
|
||||
*/
|
||||
@ApiOperation(
|
||||
tags = { "pet" },
|
||||
value = "List all pets",
|
||||
nickname = "listAllPets",
|
||||
notes = "",
|
||||
response = Pet.class,
|
||||
responseContainer = "List",
|
||||
authorizations = {
|
||||
@Authorization(value = "petstore_auth", scopes = {
|
||||
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}
|
||||
)
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
@ApiResponse(code = 400, message = "Invalid status value")
|
||||
})
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/pet/all",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
default ResponseEntity<List<Pet>> listAllPets(
|
||||
@ApiIgnore final Pageable pageable
|
||||
) {
|
||||
return getDelegate().listAllPets(pageable);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet
|
||||
*
|
||||
|
@ -141,6 +141,32 @@ public interface PetApiDelegate {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /pet/all : List all pets
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid status value (status code 400)
|
||||
* @see PetApi#listAllPets
|
||||
*/
|
||||
default ResponseEntity<List<Pet>> listAllPets(final Pageable pageable) {
|
||||
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\" }, { \"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> <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;
|
||||
}
|
||||
}
|
||||
});
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet
|
||||
*
|
||||
|
@ -135,6 +135,37 @@ paths:
|
||||
x-accepts: application/json
|
||||
x-tags:
|
||||
- tag: pet
|
||||
/pet/all:
|
||||
get:
|
||||
operationId: listAllPets
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
type: array
|
||||
application/json:
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
type: array
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid status value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- write:pets
|
||||
- read:pets
|
||||
summary: List all pets
|
||||
tags:
|
||||
- pet
|
||||
x-spring-paginated: true
|
||||
x-accepts: application/json
|
||||
x-tags:
|
||||
- tag: pet
|
||||
/pet/findByTags:
|
||||
get:
|
||||
deprecated: true
|
||||
|
@ -268,6 +268,57 @@ public interface PetApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GET /pet/all : List all pets
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid status value (status code 400)
|
||||
*/
|
||||
@ApiOperation(
|
||||
tags = { "pet" },
|
||||
value = "List all pets",
|
||||
nickname = "listAllPets",
|
||||
notes = "",
|
||||
response = Pet.class,
|
||||
responseContainer = "List",
|
||||
authorizations = {
|
||||
@Authorization(value = "petstore_auth", scopes = {
|
||||
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}
|
||||
)
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
@ApiResponse(code = 400, message = "Invalid status value")
|
||||
})
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/pet/all",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
default ResponseEntity<List<Pet>> listAllPets(
|
||||
@ApiIgnore final Pageable pageable
|
||||
) {
|
||||
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\" }, { \"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> <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;
|
||||
}
|
||||
}
|
||||
});
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet
|
||||
*
|
||||
|
@ -135,6 +135,37 @@ paths:
|
||||
x-accepts: application/json
|
||||
x-tags:
|
||||
- tag: pet
|
||||
/pet/all:
|
||||
get:
|
||||
operationId: listAllPets
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
type: array
|
||||
application/json:
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
type: array
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid status value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- write:pets
|
||||
- read:pets
|
||||
summary: List all pets
|
||||
tags:
|
||||
- pet
|
||||
x-spring-paginated: true
|
||||
x-accepts: application/json
|
||||
x-tags:
|
||||
- tag: pet
|
||||
/pet/findByTags:
|
||||
get:
|
||||
deprecated: true
|
||||
|
@ -268,6 +268,57 @@ public interface PetApi {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GET /pet/all : List all pets
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid status value (status code 400)
|
||||
*/
|
||||
@ApiOperation(
|
||||
tags = { "pet" },
|
||||
value = "List all pets",
|
||||
nickname = "listAllPets",
|
||||
notes = "",
|
||||
response = Pet.class,
|
||||
responseContainer = "List",
|
||||
authorizations = {
|
||||
@Authorization(value = "petstore_auth", scopes = {
|
||||
@AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||
@AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||
})
|
||||
}
|
||||
)
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
|
||||
@ApiResponse(code = 400, message = "Invalid status value")
|
||||
})
|
||||
@RequestMapping(
|
||||
method = RequestMethod.GET,
|
||||
value = "/pet/all",
|
||||
produces = { "application/xml", "application/json" }
|
||||
)
|
||||
default ResponseEntity<List<Pet>> listAllPets(
|
||||
@ApiIgnore final Pageable pageable
|
||||
) {
|
||||
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\" }, { \"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> <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;
|
||||
}
|
||||
}
|
||||
});
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet
|
||||
*
|
||||
|
@ -135,6 +135,37 @@ paths:
|
||||
x-accepts: application/json
|
||||
x-tags:
|
||||
- tag: pet
|
||||
/pet/all:
|
||||
get:
|
||||
operationId: listAllPets
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
type: array
|
||||
application/json:
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
type: array
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid status value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- write:pets
|
||||
- read:pets
|
||||
summary: List all pets
|
||||
tags:
|
||||
- pet
|
||||
x-spring-paginated: true
|
||||
x-accepts: application/json
|
||||
x-tags:
|
||||
- tag: pet
|
||||
/pet/findByTags:
|
||||
get:
|
||||
deprecated: true
|
||||
|
Loading…
x
Reference in New Issue
Block a user