forked from loafle/openapi-generator-original
[kotlin-spring] Handle arrays of files correctly using MultipartFile (#20108)
* [kotlin-spring] Fix no List being used for an array of files using multipart/form-data * [kotlin-spring] Use Spring's MultipartFile class for incoming Files instead of Spring's Resource class. * [kotlin-spring] Add test to ensure that return type for files is `org.springframework.core.io.Resource` * [kotlin-spring] Ensure Array is used for lists of files in generated Api class * Update samples * [kotlin-spring] Move conditional usage of MultipartFile to optionalDataType.mustache. Update samples * update samples --------- Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
parent
b3d172a44f
commit
e131d52ad0
@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
{{#appendRequestToHandler}}
|
{{#appendRequestToHandler}}
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||||
{{/appendRequestToHandler}}
|
{{/appendRequestToHandler}}
|
||||||
@ -33,7 +32,7 @@ interface {{classname}}Delegate {
|
|||||||
/**
|
/**
|
||||||
* @see {{classname}}#{{operationId}}
|
* @see {{classname}}#{{operationId}}
|
||||||
*/
|
*/
|
||||||
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^isFile}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{/isFile}}{{#isFile}}Resource?{{/isFile}}{{^-last}},
|
{{#reactive}}{{^isArray}}suspend {{/isArray}}{{/reactive}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}{{#isBodyParam}}Flow<{{{baseType}}}>{{/isBodyParam}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{/isArray}}{{/reactive}}{{^-last}},
|
||||||
{{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}}{{^skipDefaultDelegateInterface}} {
|
{{/-last}}{{/allParams}}): {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}}{{^skipDefaultDelegateInterface}} {
|
||||||
{{>methodBody}}
|
{{>methodBody}}
|
||||||
}{{/skipDefaultDelegateInterface}}
|
}{{/skipDefaultDelegateInterface}}
|
||||||
|
@ -1 +1 @@
|
|||||||
{{#required}}{{{dataType}}}{{/required}}{{^required}}{{#defaultValue}}{{{dataType}}}{{/defaultValue}}{{^defaultValue}}{{{dataType}}}?{{/defaultValue}}{{/required}}
|
{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}Array<{{/isArray}}org.springframework.web.multipart.MultipartFile{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}?{{/required}}{{/isArray}}{{/isFile}}
|
@ -92,14 +92,14 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.setLibrary("spring-cloud");
|
codegen.setLibrary("spring-cloud");
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/feat13488_use_kotlinSpring_with_springCloud.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/feat13488_use_kotlinSpring_with_springCloud.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
// Check that the @RequestMapping annotation is not generated in the Api file
|
// Check that the @RequestMapping annotation is not generated in the Api file
|
||||||
assertFileNotContains(
|
assertFileNotContains(
|
||||||
Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"),
|
Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"),
|
||||||
"@RequestMapping(\"\\${api.base-path"
|
"@RequestMapping(\"\\${api.base-path"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,18 +290,18 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_TAGS, true);
|
codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_TAGS, true);
|
||||||
|
|
||||||
List<File> files = new DefaultGenerator()
|
List<File> files = new DefaultGenerator()
|
||||||
.opts(
|
.opts(
|
||||||
new ClientOptInput()
|
new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue5497-use-tags-kotlin.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue5497-use-tags-kotlin.yaml"))
|
||||||
.config(codegen)
|
.config(codegen)
|
||||||
)
|
)
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
Assertions.assertThat(files).contains(
|
Assertions.assertThat(files).contains(
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt")
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,51 +315,51 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_TAGS, true);
|
codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_TAGS, true);
|
||||||
|
|
||||||
List<File> files = new DefaultGenerator()
|
List<File> files = new DefaultGenerator()
|
||||||
.opts(
|
.opts(
|
||||||
new ClientOptInput()
|
new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue7325-use-delegate-reactive-tags-kotlin.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue7325-use-delegate-reactive-tags-kotlin.yaml"))
|
||||||
.config(codegen)
|
.config(codegen)
|
||||||
)
|
)
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
Assertions.assertThat(files).contains(
|
Assertions.assertThat(files).contains(
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV1Api.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV1Api.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiController.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV2Api.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV2Api.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiController.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV3Api.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV3Api.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV3ApiController.kt"),
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV3ApiController.kt"),
|
||||||
new File(output, "src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt")
|
new File(output, "src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt")
|
||||||
);
|
);
|
||||||
|
|
||||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"),
|
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"),
|
||||||
"suspend fun");
|
"suspend fun");
|
||||||
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"),
|
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1Api.kt"),
|
||||||
"exchange");
|
"exchange");
|
||||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
|
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
|
||||||
"suspend fun");
|
"suspend fun");
|
||||||
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
|
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV1ApiDelegate.kt"),
|
||||||
"ApiUtil");
|
"ApiUtil");
|
||||||
|
|
||||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2Api.kt"),
|
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2Api.kt"),
|
||||||
"import kotlinx.coroutines.flow.Flow", "ResponseEntity<Flow<kotlin.String>>");
|
"import kotlinx.coroutines.flow.Flow", "ResponseEntity<Flow<kotlin.String>>");
|
||||||
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2Api.kt"),
|
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2Api.kt"),
|
||||||
"exchange");
|
"exchange");
|
||||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"),
|
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"),
|
||||||
"import kotlinx.coroutines.flow.Flow", "ResponseEntity<Flow<kotlin.String>>");
|
"import kotlinx.coroutines.flow.Flow", "ResponseEntity<Flow<kotlin.String>>");
|
||||||
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"),
|
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV2ApiDelegate.kt"),
|
||||||
"suspend fun", "ApiUtil");
|
"suspend fun", "ApiUtil");
|
||||||
|
|
||||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3Api.kt"),
|
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3Api.kt"),
|
||||||
"import kotlinx.coroutines.flow.Flow", "requestBody: Flow<kotlin.Long>");
|
"import kotlinx.coroutines.flow.Flow", "requestBody: Flow<kotlin.Long>");
|
||||||
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3Api.kt"),
|
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3Api.kt"),
|
||||||
"exchange");
|
"exchange");
|
||||||
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt"),
|
assertFileContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt"),
|
||||||
"import kotlinx.coroutines.flow.Flow", "suspend fun", "requestBody: Flow<kotlin.Long>");
|
"import kotlinx.coroutines.flow.Flow", "suspend fun", "requestBody: Flow<kotlin.Long>");
|
||||||
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt"),
|
assertFileNotContains(Paths.get(output + "/src/main/kotlin/org/openapitools/api/TestV3ApiDelegate.kt"),
|
||||||
"ApiUtil");
|
"ApiUtil");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -400,7 +400,7 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||||
|
|
||||||
OpenAPI openAPI = new OpenAPIParser()
|
OpenAPI openAPI = new OpenAPIParser()
|
||||||
.readLocation("src/test/resources/3_0/objectQueryParam.yaml", null, new ParseOptions()).getOpenAPI();
|
.readLocation("src/test/resources/3_0/objectQueryParam.yaml", null, new ParseOptions()).getOpenAPI();
|
||||||
|
|
||||||
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
codegen.setOutputDir(output.getAbsolutePath());
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
@ -430,7 +430,7 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||||
|
|
||||||
OpenAPI openAPI = new OpenAPIParser()
|
OpenAPI openAPI = new OpenAPIParser()
|
||||||
.readLocation("src/test/resources/3_0/issue_3248.yaml", null, new ParseOptions()).getOpenAPI();
|
.readLocation("src/test/resources/3_0/issue_3248.yaml", null, new ParseOptions()).getOpenAPI();
|
||||||
|
|
||||||
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
codegen.setOutputDir(output.getAbsolutePath());
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
@ -467,7 +467,7 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||||
|
|
||||||
OpenAPI openAPI = new OpenAPIParser()
|
OpenAPI openAPI = new OpenAPIParser()
|
||||||
.readLocation("src/test/resources/3_0/issue_2053.yaml", null, new ParseOptions()).getOpenAPI();
|
.readLocation("src/test/resources/3_0/issue_2053.yaml", null, new ParseOptions()).getOpenAPI();
|
||||||
|
|
||||||
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
codegen.setOutputDir(output.getAbsolutePath());
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
@ -487,12 +487,12 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
generator.opts(input).generate();
|
generator.opts(input).generate();
|
||||||
|
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ElephantsApiController.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ElephantsApiController.kt"),
|
||||||
"@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE)"
|
"@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE)"
|
||||||
);
|
);
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ZebrasApiController.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ZebrasApiController.kt"),
|
||||||
"@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)"
|
"@org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -507,13 +507,13 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.BEAN_QUALIFIERS, true);
|
codegen.additionalProperties().put(KotlinSpringServerCodegen.BEAN_QUALIFIERS, true);
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/bean-qualifiers.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/bean-qualifiers.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApiController.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApiController.kt"),
|
||||||
"@RestController(\"org.openapitools.api.PingApiController\")"
|
"@RestController(\"org.openapitools.api.PingApiController\")"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -529,13 +529,13 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.SKIP_DEFAULT_INTERFACE, true);
|
codegen.additionalProperties().put(KotlinSpringServerCodegen.SKIP_DEFAULT_INTERFACE, true);
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/skip-default-interface.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/skip-default-interface.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
assertFileNotContains(
|
assertFileNotContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApi.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApi.kt"),
|
||||||
"return "
|
"return "
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -551,13 +551,13 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.SKIP_DEFAULT_INTERFACE, true);
|
codegen.additionalProperties().put(KotlinSpringServerCodegen.SKIP_DEFAULT_INTERFACE, true);
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/FakeApi.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/FakeApi.kt"),
|
||||||
"@CookieValue"
|
"@CookieValue"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -571,13 +571,13 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.setOutputDir(output.getAbsolutePath());
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-fake-endpoints-for-testing-with-cookie.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/FakeApiController.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/FakeApiController.kt"),
|
||||||
"@CookieValue"
|
"@CookieValue"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,21 +592,21 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_SPRING_BOOT3, true);
|
codegen.additionalProperties().put(KotlinSpringServerCodegen.USE_SPRING_BOOT3, true);
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/feat13578_use_springboot3_jakarta_extension.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/feat13578_use_springboot3_jakarta_extension.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ApiUtil.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/ApiUtil.kt"),
|
||||||
"import jakarta.servlet.http.HttpServletResponse"
|
"import jakarta.servlet.http.HttpServletResponse"
|
||||||
);
|
);
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/Exceptions.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/Exceptions.kt"),
|
||||||
"import jakarta.validation.ConstraintViolationException"
|
"import jakarta.validation.ConstraintViolationException"
|
||||||
);
|
);
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApiController.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApiController.kt"),
|
||||||
"import jakarta.validation.Valid"
|
"import jakarta.validation.Valid"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -628,12 +628,12 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
codegen.setOutputDir(output.getAbsolutePath());
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.INTERFACE_ONLY,
|
codegen.additionalProperties().put(KotlinSpringServerCodegen.INTERFACE_ONLY,
|
||||||
isInterfaceOnly);
|
isInterfaceOnly);
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue4111-multiline-operation-description.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue4111-multiline-operation-description.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
final String pingApiFileName;
|
final String pingApiFileName;
|
||||||
if (isInterfaceOnly) {
|
if (isInterfaceOnly) {
|
||||||
@ -642,15 +642,15 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
pingApiFileName = "PingApiController.kt";
|
pingApiFileName = "PingApiController.kt";
|
||||||
}
|
}
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(
|
Paths.get(
|
||||||
outputPath + "/src/main/kotlin/org/openapitools/api/" + pingApiFileName),
|
outputPath + "/src/main/kotlin/org/openapitools/api/" + pingApiFileName),
|
||||||
"description = \"\"\"# Multi-line descriptions\n"
|
"description = \"\"\"# Multi-line descriptions\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "This is an example of a multi-line description.\n"
|
+ "This is an example of a multi-line description.\n"
|
||||||
+ "\n"
|
+ "\n"
|
||||||
+ "It:\n"
|
+ "It:\n"
|
||||||
+ "- has multiple lines\n"
|
+ "- has multiple lines\n"
|
||||||
+ "- uses Markdown (CommonMark) for rich text representation\"\"\""
|
+ "- uses Markdown (CommonMark) for rich text representation\"\"\""
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -664,25 +664,25 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.setOutputDir(output.getAbsolutePath());
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue3596-use-correct-get-annotation-target.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue3596-use-correct-get-annotation-target.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
assertFileNotContains(
|
assertFileNotContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
||||||
"@Schema(example = \"null\", description = \"\")"
|
"@Schema(example = \"null\", description = \"\")"
|
||||||
);
|
);
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
||||||
"@get:Schema(example = \"null\", description = \"\")"
|
"@get:Schema(example = \"null\", description = \"\")"
|
||||||
);
|
);
|
||||||
assertFileNotContains(
|
assertFileNotContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
||||||
"@Schema(example = \"null\", requiredMode = Schema.RequiredMode.REQUIRED, description = \"\")"
|
"@Schema(example = \"null\", requiredMode = Schema.RequiredMode.REQUIRED, description = \"\")"
|
||||||
);
|
);
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
||||||
"@get:Schema(example = \"null\", requiredMode = Schema.RequiredMode.REQUIRED, description = \"\")"
|
"@get:Schema(example = \"null\", requiredMode = Schema.RequiredMode.REQUIRED, description = \"\")"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -698,25 +698,25 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, DocumentationProvider.SPRINGFOX.toCliOptValue());
|
codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, DocumentationProvider.SPRINGFOX.toCliOptValue());
|
||||||
|
|
||||||
new DefaultGenerator().opts(new ClientOptInput()
|
new DefaultGenerator().opts(new ClientOptInput()
|
||||||
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue3596-use-correct-get-annotation-target.yaml"))
|
.openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue3596-use-correct-get-annotation-target.yaml"))
|
||||||
.config(codegen))
|
.config(codegen))
|
||||||
.generate();
|
.generate();
|
||||||
|
|
||||||
assertFileNotContains(
|
assertFileNotContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
||||||
"@ApiModelProperty(example = \"null\", value = \"\")"
|
"@ApiModelProperty(example = \"null\", value = \"\")"
|
||||||
);
|
);
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
||||||
"@get:ApiModelProperty(example = \"null\", value = \"\")"
|
"@get:ApiModelProperty(example = \"null\", value = \"\")"
|
||||||
);
|
);
|
||||||
assertFileNotContains(
|
assertFileNotContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
||||||
"@ApiModelProperty(example = \"null\", required = true, value = \"\")"
|
"@ApiModelProperty(example = \"null\", required = true, value = \"\")"
|
||||||
);
|
);
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Animal.kt"),
|
||||||
"@get:ApiModelProperty(example = \"null\", required = true, value = \"\")"
|
"@get:ApiModelProperty(example = \"null\", required = true, value = \"\")"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,7 +726,7 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
output.deleteOnExit();
|
output.deleteOnExit();
|
||||||
|
|
||||||
OpenAPI openAPI = new OpenAPIParser()
|
OpenAPI openAPI = new OpenAPIParser()
|
||||||
.readLocation("src/test/resources/bugs/issue_13932.yml", null, new ParseOptions()).getOpenAPI();
|
.readLocation("src/test/resources/bugs/issue_13932.yml", null, new ParseOptions()).getOpenAPI();
|
||||||
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
codegen.setOutputDir(output.getAbsolutePath());
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
codegen.additionalProperties().put(KotlinSpringServerCodegen.INTERFACE_ONLY, "true");
|
codegen.additionalProperties().put(KotlinSpringServerCodegen.INTERFACE_ONLY, "true");
|
||||||
@ -735,19 +735,88 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller");
|
codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller");
|
||||||
|
|
||||||
ClientOptInput input = new ClientOptInput()
|
ClientOptInput input = new ClientOptInput()
|
||||||
.openAPI(openAPI)
|
.openAPI(openAPI)
|
||||||
.config(codegen);
|
.config(codegen);
|
||||||
|
|
||||||
DefaultGenerator generator = new DefaultGenerator();
|
DefaultGenerator generator = new DefaultGenerator();
|
||||||
Map<String, File> files = generator.opts(input).generate().stream()
|
Map<String, File> files = generator.opts(input).generate().stream()
|
||||||
.collect(Collectors.toMap(File::getName, Function.identity()));
|
.collect(Collectors.toMap(File::getName, Function.identity()));
|
||||||
|
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
Paths.get(files.get("AddApi.kt").getAbsolutePath()),
|
Paths.get(files.get("AddApi.kt").getAbsolutePath()),
|
||||||
"@Min(2)"
|
"@Min(2)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenMultipartFormArray_whenGenerateDelegateAndService_thenParameterIsCreatedAsListOfMultipartFile() throws IOException {
|
||||||
|
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||||
|
output.deleteOnExit();
|
||||||
|
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||||
|
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/petstore-with-tags.yaml");
|
||||||
|
final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
|
codegen.setDelegatePattern(true);
|
||||||
|
codegen.setServiceInterface(true);
|
||||||
|
|
||||||
|
ClientOptInput input = new ClientOptInput();
|
||||||
|
input.openAPI(openAPI);
|
||||||
|
input.config(codegen);
|
||||||
|
|
||||||
|
DefaultGenerator generator = new DefaultGenerator();
|
||||||
|
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false");
|
||||||
|
|
||||||
|
generator.opts(input).generate();
|
||||||
|
|
||||||
|
Path delegateFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt");
|
||||||
|
assertFileContains(delegateFile, "additionalMetadata: kotlin.String?");
|
||||||
|
assertFileContains(delegateFile, "images: Array<org.springframework.web.multipart.MultipartFile>");
|
||||||
|
|
||||||
|
Path controllerFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApi.kt");
|
||||||
|
assertFileContains(controllerFile, "images: Array<org.springframework.web.multipart.MultipartFile>");
|
||||||
|
|
||||||
|
|
||||||
|
Path serviceFile = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiService.kt");
|
||||||
|
assertFileContains(serviceFile, "images: Array<org.springframework.web.multipart.MultipartFile>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void givenOctetStreamResponseType_whenGenerateServer_thenReturnTypeIsResource() throws IOException {
|
||||||
|
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||||
|
output.deleteOnExit();
|
||||||
|
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||||
|
|
||||||
|
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/kotlin/petstore-with-tags.yaml");
|
||||||
|
final KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen();
|
||||||
|
codegen.setOpenAPI(openAPI);
|
||||||
|
codegen.setOutputDir(output.getAbsolutePath());
|
||||||
|
|
||||||
|
ClientOptInput input = new ClientOptInput();
|
||||||
|
input.openAPI(openAPI);
|
||||||
|
input.config(codegen);
|
||||||
|
|
||||||
|
DefaultGenerator generator = new DefaultGenerator();
|
||||||
|
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "true");
|
||||||
|
generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false");
|
||||||
|
|
||||||
|
generator.opts(input).generate();
|
||||||
|
|
||||||
|
Path outputFilepath = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiController.kt");
|
||||||
|
|
||||||
|
assertFileContains(outputFilepath, "): ResponseEntity<org.springframework.core.io.Resource>");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenMultipartForm_whenGenerateReactiveServer_thenParameterAreCreatedAsRequestPart() throws IOException {
|
public void givenMultipartForm_whenGenerateReactiveServer_thenParameterAreCreatedAsRequestPart() throws IOException {
|
||||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||||
@ -776,9 +845,9 @@ public class KotlinSpringServerCodegenTest {
|
|||||||
Path outputFilepath = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiController.kt");
|
Path outputFilepath = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PetApiController.kt");
|
||||||
|
|
||||||
assertFileContains(outputFilepath,
|
assertFileContains(outputFilepath,
|
||||||
"@Parameter(description = \"Additional data to pass to server\") @RequestParam(value = \"additionalMetadata\", required = false) additionalMetadata: kotlin.String?");
|
"@Parameter(description = \"Additional data to pass to server\") @RequestParam(value = \"additionalMetadata\", required = false) additionalMetadata: kotlin.String?");
|
||||||
assertFileContains(outputFilepath,
|
assertFileContains(outputFilepath,
|
||||||
"@Parameter(description = \"image to upload\") @Valid @RequestPart(\"image\", required = false) image: org.springframework.core.io.Resource?");
|
"@Parameter(description = \"image to upload\") @Valid @RequestPart(\"image\", required = false) image: org.springframework.web.multipart.MultipartFile");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,19 +8,19 @@ info:
|
|||||||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
servers:
|
servers:
|
||||||
- url: http://petstore.swagger.io/v2
|
- url: http://petstore.swagger.io/v2
|
||||||
tags:
|
tags:
|
||||||
- name: pet
|
- name: pet
|
||||||
description: Everything about your Pets
|
description: Everything about your Pets
|
||||||
- name: store
|
- name: store
|
||||||
description: Access to Petstore orders
|
description: Access to Petstore orders
|
||||||
- name: user
|
- name: user
|
||||||
description: Operations about user
|
description: Operations about user
|
||||||
paths:
|
paths:
|
||||||
/pet:
|
/pet:
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
summary: Update an existing pet
|
summary: Update an existing pet
|
||||||
operationId: updatePet
|
operationId: updatePet
|
||||||
requestBody:
|
requestBody:
|
||||||
@ -36,21 +36,21 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: Pet not found
|
description: Pet not found
|
||||||
content: {}
|
content: { }
|
||||||
405:
|
405:
|
||||||
description: Validation exception
|
description: Validation exception
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
- read:pets
|
- read:pets
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
summary: Add a new pet to the store
|
summary: Add a new pet to the store
|
||||||
operationId: addPet
|
operationId: addPet
|
||||||
requestBody:
|
requestBody:
|
||||||
@ -66,35 +66,35 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
405:
|
405:
|
||||||
description: Invalid input
|
description: Invalid input
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
- read:pets
|
- read:pets
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/pet/findByStatus:
|
/pet/findByStatus:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
summary: Finds Pets by status
|
summary: Finds Pets by status
|
||||||
description: Multiple status values can be provided with comma separated strings
|
description: Multiple status values can be provided with comma separated strings
|
||||||
operationId: findPetsByStatus
|
operationId: findPetsByStatus
|
||||||
parameters:
|
parameters:
|
||||||
- name: status
|
- name: status
|
||||||
in: query
|
in: query
|
||||||
description: Status values that need to be considered for filter
|
description: Status values that need to be considered for filter
|
||||||
required: true
|
required: true
|
||||||
style: form
|
style: form
|
||||||
explode: false
|
explode: false
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
default: available
|
default: available
|
||||||
enum:
|
enum:
|
||||||
- available
|
- available
|
||||||
- pending
|
- pending
|
||||||
- sold
|
- sold
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
@ -111,31 +111,31 @@ paths:
|
|||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
400:
|
400:
|
||||||
description: Invalid status value
|
description: Invalid status value
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
- read:pets
|
- read:pets
|
||||||
x-spring-paginated: true
|
x-spring-paginated: true
|
||||||
/pet/findByTags:
|
/pet/findByTags:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
summary: Finds Pets by tags
|
summary: Finds Pets by tags
|
||||||
description: Multiple tags can be provided with comma separated strings. Use
|
description: Multiple tags can be provided with comma separated strings. Use
|
||||||
tag1, tag2, tag3 for testing.
|
tag1, tag2, tag3 for testing.
|
||||||
operationId: findPetsByTags
|
operationId: findPetsByTags
|
||||||
parameters:
|
parameters:
|
||||||
- name: tags
|
- name: tags
|
||||||
in: query
|
in: query
|
||||||
description: Tags to filter by
|
description: Tags to filter by
|
||||||
required: true
|
required: true
|
||||||
style: form
|
style: form
|
||||||
explode: false
|
explode: false
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
@ -152,28 +152,28 @@ paths:
|
|||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
400:
|
400:
|
||||||
description: Invalid tag value
|
description: Invalid tag value
|
||||||
content: {}
|
content: { }
|
||||||
deprecated: true
|
deprecated: true
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
- read:pets
|
- read:pets
|
||||||
x-spring-paginated: true
|
x-spring-paginated: true
|
||||||
/pet/{petId}:
|
/pet/{petId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
summary: Find pet by ID
|
summary: Find pet by ID
|
||||||
description: Returns a single pet
|
description: Returns a single pet
|
||||||
operationId: getPetById
|
operationId: getPetById
|
||||||
parameters:
|
parameters:
|
||||||
- name: petId
|
- name: petId
|
||||||
in: path
|
in: path
|
||||||
description: ID of pet to return
|
description: ID of pet to return
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
@ -186,25 +186,25 @@ paths:
|
|||||||
$ref: '#/components/schemas/Pet'
|
$ref: '#/components/schemas/Pet'
|
||||||
400:
|
400:
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: Pet not found
|
description: Pet not found
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: [ ]
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
summary: Updates a pet in the store with form data
|
summary: Updates a pet in the store with form data
|
||||||
operationId: updatePetWithForm
|
operationId: updatePetWithForm
|
||||||
parameters:
|
parameters:
|
||||||
- name: petId
|
- name: petId
|
||||||
in: path
|
in: path
|
||||||
description: ID of pet that needs to be updated
|
description: ID of pet that needs to be updated
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/x-www-form-urlencoded:
|
application/x-www-form-urlencoded:
|
||||||
@ -219,50 +219,50 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
405:
|
405:
|
||||||
description: Invalid input
|
description: Invalid input
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
- read:pets
|
- read:pets
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
summary: Deletes a pet
|
summary: Deletes a pet
|
||||||
operationId: deletePet
|
operationId: deletePet
|
||||||
parameters:
|
parameters:
|
||||||
- name: api_key
|
- name: api_key
|
||||||
in: header
|
in: header
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
- name: petId
|
- name: petId
|
||||||
in: path
|
in: path
|
||||||
description: Pet id to delete
|
description: Pet id to delete
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid pet value
|
description: Invalid pet value
|
||||||
content: {}
|
content: { }
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
- read:pets
|
- read:pets
|
||||||
/pet/{petId}/uploadImage:
|
/pet/{petId}/uploadImage:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- pet tag
|
- pet tag
|
||||||
summary: uploads an image
|
summary: uploads an image
|
||||||
operationId: uploadFile
|
operationId: uploadFile
|
||||||
parameters:
|
parameters:
|
||||||
- name: petId
|
- name: petId
|
||||||
in: path
|
in: path
|
||||||
description: ID of pet to update
|
description: ID of pet to update
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
multipart/form-data:
|
multipart/form-data:
|
||||||
@ -285,13 +285,80 @@ paths:
|
|||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/ApiResponse'
|
$ref: '#/components/schemas/ApiResponse'
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- write:pets
|
- write:pets
|
||||||
- read:pets
|
- read:pets
|
||||||
|
/pet/{petId}/uploadMultipleImage:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- pet tag
|
||||||
|
summary: uploads multiple images
|
||||||
|
operationId: uploadMultipleFile
|
||||||
|
parameters:
|
||||||
|
- name: petId
|
||||||
|
in: path
|
||||||
|
description: ID of pet to update
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
properties:
|
||||||
|
additionalMetadata:
|
||||||
|
type: string
|
||||||
|
description: Additional data to pass to server
|
||||||
|
required: false
|
||||||
|
images:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: image to upload
|
||||||
|
format: binary
|
||||||
|
required: true
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ApiResponse'
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- write:pets
|
||||||
|
- read:pets
|
||||||
|
/pet/{petId}/getImage:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- pet tag
|
||||||
|
summary: Get an image
|
||||||
|
operationId: getImage
|
||||||
|
parameters:
|
||||||
|
- name: petId
|
||||||
|
in: path
|
||||||
|
description: ID of pet to get image
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/octet-stream:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
format: binary
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- write:pets
|
||||||
|
- read:pets
|
||||||
/store/inventory:
|
/store/inventory:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- store tag
|
- store tag
|
||||||
summary: Returns pet inventories by status
|
summary: Returns pet inventories by status
|
||||||
description: Returns a map of status codes to quantities
|
description: Returns a map of status codes to quantities
|
||||||
operationId: getInventory
|
operationId: getInventory
|
||||||
@ -306,11 +373,11 @@ paths:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: [ ]
|
||||||
/store/order:
|
/store/order:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- store tag
|
- store tag
|
||||||
summary: Place an order for a pet
|
summary: Place an order for a pet
|
||||||
operationId: placeOrder
|
operationId: placeOrder
|
||||||
requestBody:
|
requestBody:
|
||||||
@ -332,26 +399,26 @@ paths:
|
|||||||
$ref: '#/components/schemas/Order'
|
$ref: '#/components/schemas/Order'
|
||||||
400:
|
400:
|
||||||
description: Invalid Order
|
description: Invalid Order
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/store/order/{orderId}:
|
/store/order/{orderId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- store tag
|
- store tag
|
||||||
summary: Find purchase order by ID
|
summary: Find purchase order by ID
|
||||||
description: For valid response try integer IDs with value <= 5 or > 10. Other
|
description: For valid response try integer IDs with value <= 5 or > 10. Other
|
||||||
values will generate exceptions
|
values will generate exceptions
|
||||||
operationId: getOrderById
|
operationId: getOrderById
|
||||||
parameters:
|
parameters:
|
||||||
- name: orderId
|
- name: orderId
|
||||||
in: path
|
in: path
|
||||||
description: ID of pet that needs to be fetched
|
description: ID of pet that needs to be fetched
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
maximum: 5
|
maximum: 5
|
||||||
minimum: 1
|
minimum: 1
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
@ -364,35 +431,35 @@ paths:
|
|||||||
$ref: '#/components/schemas/Order'
|
$ref: '#/components/schemas/Order'
|
||||||
400:
|
400:
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: Order not found
|
description: Order not found
|
||||||
content: {}
|
content: { }
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- store tag
|
- store tag
|
||||||
summary: Delete purchase order by ID
|
summary: Delete purchase order by ID
|
||||||
description: For valid response try integer IDs with value < 1000. Anything
|
description: For valid response try integer IDs with value < 1000. Anything
|
||||||
above 1000 or nonintegers will generate API errors
|
above 1000 or nonintegers will generate API errors
|
||||||
operationId: deleteOrder
|
operationId: deleteOrder
|
||||||
parameters:
|
parameters:
|
||||||
- name: orderId
|
- name: orderId
|
||||||
in: path
|
in: path
|
||||||
description: ID of the order that needs to be deleted
|
description: ID of the order that needs to be deleted
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid ID supplied
|
description: Invalid ID supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: Order not found
|
description: Order not found
|
||||||
content: {}
|
content: { }
|
||||||
/user:
|
/user:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: Create user
|
summary: Create user
|
||||||
description: This can only be done by the logged in user.
|
description: This can only be done by the logged in user.
|
||||||
operationId: createUser
|
operationId: createUser
|
||||||
@ -406,12 +473,12 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/user/createWithArray:
|
/user/createWithArray:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: Creates list of users with given input array
|
summary: Creates list of users with given input array
|
||||||
operationId: createUsersWithArrayInput
|
operationId: createUsersWithArrayInput
|
||||||
requestBody:
|
requestBody:
|
||||||
@ -426,12 +493,12 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/user/createWithList:
|
/user/createWithList:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: Creates list of users with given input array
|
summary: Creates list of users with given input array
|
||||||
operationId: createUsersWithListInput
|
operationId: createUsersWithListInput
|
||||||
requestBody:
|
requestBody:
|
||||||
@ -446,27 +513,27 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
/user/login:
|
/user/login:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: Logs user into the system
|
summary: Logs user into the system
|
||||||
operationId: loginUser
|
operationId: loginUser
|
||||||
parameters:
|
parameters:
|
||||||
- name: username
|
- name: username
|
||||||
in: query
|
in: query
|
||||||
description: The user name for login
|
description: The user name for login
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
- name: password
|
- name: password
|
||||||
in: query
|
in: query
|
||||||
description: The password for login in clear text
|
description: The password for login in clear text
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
@ -490,39 +557,39 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
400:
|
400:
|
||||||
description: Invalid username/password supplied
|
description: Invalid username/password supplied
|
||||||
content: {}
|
content: { }
|
||||||
/user/logout:
|
/user/logout:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: Logs out current logged in user session
|
summary: Logs out current logged in user session
|
||||||
operationId: logoutUser
|
operationId: logoutUser
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content: {}
|
content: { }
|
||||||
options:
|
options:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: logoutUserOptions
|
summary: logoutUserOptions
|
||||||
operationId: logoutUserOptions
|
operationId: logoutUserOptions
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: endpoint configuration response
|
description: endpoint configuration response
|
||||||
content: {}
|
content: { }
|
||||||
/user/{username}:
|
/user/{username}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: Get user by user name
|
summary: Get user by user name
|
||||||
operationId: getUserByName
|
operationId: getUserByName
|
||||||
parameters:
|
parameters:
|
||||||
- name: username
|
- name: username
|
||||||
in: path
|
in: path
|
||||||
description: The name that needs to be fetched. Use user1 for testing.
|
description: The name that needs to be fetched. Use user1 for testing.
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: successful operation
|
description: successful operation
|
||||||
@ -535,23 +602,23 @@ paths:
|
|||||||
$ref: '#/components/schemas/User'
|
$ref: '#/components/schemas/User'
|
||||||
400:
|
400:
|
||||||
description: Invalid username supplied
|
description: Invalid username supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: User not found
|
description: User not found
|
||||||
content: {}
|
content: { }
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: Updated user
|
summary: Updated user
|
||||||
description: This can only be done by the logged in user.
|
description: This can only be done by the logged in user.
|
||||||
operationId: updateUser
|
operationId: updateUser
|
||||||
parameters:
|
parameters:
|
||||||
- name: username
|
- name: username
|
||||||
in: path
|
in: path
|
||||||
description: name that need to be deleted
|
description: name that need to be deleted
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
requestBody:
|
requestBody:
|
||||||
description: Updated user object
|
description: Updated user object
|
||||||
content:
|
content:
|
||||||
@ -562,31 +629,31 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid user supplied
|
description: Invalid user supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: User not found
|
description: User not found
|
||||||
content: {}
|
content: { }
|
||||||
x-codegen-request-body-name: body
|
x-codegen-request-body-name: body
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- user tag
|
- user tag
|
||||||
summary: Delete user
|
summary: Delete user
|
||||||
description: This can only be done by the logged in user.
|
description: This can only be done by the logged in user.
|
||||||
operationId: deleteUser
|
operationId: deleteUser
|
||||||
parameters:
|
parameters:
|
||||||
- name: username
|
- name: username
|
||||||
in: path
|
in: path
|
||||||
description: The name that needs to be deleted
|
description: The name that needs to be deleted
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: Invalid username supplied
|
description: Invalid username supplied
|
||||||
content: {}
|
content: { }
|
||||||
404:
|
404:
|
||||||
description: User not found
|
description: User not found
|
||||||
content: {}
|
content: { }
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
Order:
|
Order:
|
||||||
@ -609,9 +676,9 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
description: Order Status
|
description: Order Status
|
||||||
enum:
|
enum:
|
||||||
- placed
|
- placed
|
||||||
- approved
|
- approved
|
||||||
- delivered
|
- delivered
|
||||||
complete:
|
complete:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
@ -671,8 +738,8 @@ components:
|
|||||||
Pet:
|
Pet:
|
||||||
title: a Pet
|
title: a Pet
|
||||||
required:
|
required:
|
||||||
- name
|
- name
|
||||||
- photoUrls
|
- photoUrls
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
@ -701,9 +768,9 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
description: pet status in the store
|
description: pet status in the store
|
||||||
enum:
|
enum:
|
||||||
- available
|
- available
|
||||||
- pending
|
- pending
|
||||||
- sold
|
- sold
|
||||||
description: A pet for sale in the pet store
|
description: A pet for sale in the pet store
|
||||||
xml:
|
xml:
|
||||||
name: Pet
|
name: Pet
|
||||||
|
@ -110,7 +110,7 @@ interface PetApi {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ class PetApiController() {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,5 +99,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ interface PetApi {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
@ -69,6 +68,6 @@ interface PetApiDelegate {
|
|||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long,
|
fun uploadFile(petId: kotlin.Long,
|
||||||
additionalMetadata: kotlin.String?,
|
additionalMetadata: kotlin.String?,
|
||||||
file: Resource?): ResponseEntity<ModelApiResponse>
|
file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ interface PetApi {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
return getDelegate().uploadFile(petId, additionalMetadata, file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
@ -151,7 +150,7 @@ interface PetApiDelegate {
|
|||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long,
|
fun uploadFile(petId: kotlin.Long,
|
||||||
additionalMetadata: kotlin.String?,
|
additionalMetadata: kotlin.String?,
|
||||||
file: Resource?): ResponseEntity<ModelApiResponse> {
|
file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
getRequest().ifPresent { request ->
|
getRequest().ifPresent { request ->
|
||||||
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||||
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
|
||||||
|
@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
@ -5,7 +5,6 @@ import org.springframework.http.HttpStatus
|
|||||||
import org.springframework.http.MediaType
|
import org.springframework.http.MediaType
|
||||||
import org.springframework.http.ResponseEntity
|
import org.springframework.http.ResponseEntity
|
||||||
import org.springframework.web.context.request.NativeWebRequest
|
import org.springframework.web.context.request.NativeWebRequest
|
||||||
import org.springframework.core.io.Resource
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest
|
import org.springframework.http.server.reactive.ServerHttpRequest
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class MultipartMixedApiController() {
|
|||||||
value = ["/multipart-mixed"],
|
value = ["/multipart-mixed"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.core.io.Resource,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity<Unit> {
|
fun multipartMixed(@Parameter(description = "", required = true, schema = Schema(allowableValues = ["ALLOWED", "IN_PROGRESS", "REJECTED"])) @RequestParam(value = "status", required = true) status: MultipartMixedStatus ,@Parameter(description = "a file") @Valid @RequestPart("file", required = true) file: org.springframework.web.multipart.MultipartFile,@Parameter(description = "") @RequestPart(value = "marker", required = false) marker: MultipartMixedRequestMarker? ): ResponseEntity<Unit> {
|
||||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
suspend fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
suspend fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,5 +91,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ interface PetApi {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
return ResponseEntity(HttpStatus.NOT_IMPLEMENTED)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@Parameter(description = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@Parameter(description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@Parameter(description = "file to upload") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile(@ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") petId: kotlin.Long,@ApiParam(value = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
|||||||
produces = ["application/json"],
|
produces = ["application/json"],
|
||||||
consumes = ["multipart/form-data"]
|
consumes = ["multipart/form-data"]
|
||||||
)
|
)
|
||||||
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.core.io.Resource?): ResponseEntity<ModelApiResponse> {
|
fun uploadFile( @PathVariable("petId") petId: kotlin.Long, @RequestParam(value = "additionalMetadata", required = false) additionalMetadata: kotlin.String? , @Valid @RequestPart("file", required = false) file: org.springframework.web.multipart.MultipartFile?): ResponseEntity<ModelApiResponse> {
|
||||||
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,5 @@ interface PetApiService {
|
|||||||
* @return successful operation (status code 200)
|
* @return successful operation (status code 200)
|
||||||
* @see PetApi#uploadFile
|
* @see PetApi#uploadFile
|
||||||
*/
|
*/
|
||||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse
|
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class PetApiServiceImpl : PetApiService {
|
|||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
|
override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.web.multipart.MultipartFile?): ModelApiResponse {
|
||||||
TODO("Implement me")
|
TODO("Implement me")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user