forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Kotlin][Spring] Fix RequestPart handling for multipart request (Open…
…APITools#19058) * [Kotlin][Spring] Fix RequestPart handling for multipart request * [Kotlin][Spring] Add sample spec for kotlin multipart request model --------- Co-authored-by: dimitar.tomov <[email protected]>
- Loading branch information
Showing
22 changed files
with
610 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
generatorName: kotlin-spring | ||
outputDir: samples/server/petstore/kotlin-springboot-multipart-request-model | ||
library: spring-boot | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/kotlin-spring |
2 changes: 1 addition & 1 deletion
2
modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail"){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}} | ||
{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/swagger1AnnotationLibrary}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}@RequestParam{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}} {{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail"){{/swagger1AnnotationLibrary}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}} |
45 changes: 45 additions & 0 deletions
45
modules/openapi-generator/src/test/resources/3_0/issue_15251_multipart_request_model.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
openapi: '3.0.1' | ||
info: | ||
version: 1.0.0 | ||
title: MultipartFile test | ||
paths: | ||
/multipart-mixed: | ||
post: | ||
tags: | ||
- multipart | ||
description: Mixed MultipartFile test | ||
operationId: multipartMixed | ||
requestBody: | ||
content: | ||
multipart/form-data: | ||
schema: | ||
type: object | ||
required: | ||
- status | ||
- file | ||
properties: | ||
status: | ||
$ref: '#/components/schemas/MultipartMixedStatus' | ||
marker: | ||
description: "additional object" | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
file: | ||
description: "a file" | ||
type: string | ||
format: binary | ||
responses: | ||
'204': | ||
description: Successful operation | ||
components: | ||
schemas: | ||
MultipartMixedStatus: | ||
description: "additional field as Enum" | ||
type: string | ||
enum: | ||
- ALLOWED | ||
- IN_PROGRESS | ||
- REJECTED | ||
example: REJECTED |
23 changes: 23 additions & 0 deletions
23
samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
14 changes: 14 additions & 0 deletions
14
samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
README.md | ||
build.gradle.kts | ||
pom.xml | ||
settings.gradle | ||
src/main/kotlin/org/openapitools/Application.kt | ||
src/main/kotlin/org/openapitools/HomeController.kt | ||
src/main/kotlin/org/openapitools/SpringDocConfiguration.kt | ||
src/main/kotlin/org/openapitools/api/ApiUtil.kt | ||
src/main/kotlin/org/openapitools/api/Exceptions.kt | ||
src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt | ||
src/main/kotlin/org/openapitools/model/MultipartMixedRequestMarker.kt | ||
src/main/kotlin/org/openapitools/model/MultipartMixedStatus.kt | ||
src/main/resources/application.yaml | ||
src/main/resources/openapi.yaml |
1 change: 1 addition & 0 deletions
1
samples/server/petstore/kotlin-springboot-multipart-request-model/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.8.0-SNAPSHOT |
21 changes: 21 additions & 0 deletions
21
samples/server/petstore/kotlin-springboot-multipart-request-model/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# multipartFileTest | ||
|
||
This Kotlin based [Spring Boot](https://spring.io/projects/spring-boot) application has been generated using the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator). | ||
|
||
## Getting Started | ||
|
||
This document assumes you have either maven or gradle available, either via the wrapper or otherwise. This does not come with a gradle / maven wrapper checked in. | ||
|
||
By default a [`pom.xml`](pom.xml) file will be generated. If you specified `gradleBuildFile=true` when generating this project, a `build.gradle.kts` will also be generated. Note this uses [Gradle Kotlin DSL](https://github.com/gradle/kotlin-dsl). | ||
|
||
To build the project using maven, run: | ||
```bash | ||
mvn package && java -jar target/openapi-spring-1.0.0.jar | ||
``` | ||
|
||
To build the project using gradle, run: | ||
```bash | ||
gradle build && java -jar build/libs/openapi-spring-1.0.0.jar | ||
``` | ||
|
||
If all builds successfully, the server should run on [http://localhost:8080/](http://localhost:8080/) |
50 changes: 50 additions & 0 deletions
50
samples/server/petstore/kotlin-springboot-multipart-request-model/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.6.7") | ||
} | ||
} | ||
|
||
group = "org.openapitools" | ||
version = "1.0.0" | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
tasks.withType<KotlinCompile> { | ||
kotlinOptions.jvmTarget = "1.8" | ||
} | ||
|
||
plugins { | ||
val kotlinVersion = "1.6.21" | ||
id("org.jetbrains.kotlin.jvm") version kotlinVersion | ||
id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion | ||
id("org.jetbrains.kotlin.plugin.spring") version kotlinVersion | ||
id("org.springframework.boot") version "2.6.7" | ||
id("io.spring.dependency-management") version "1.0.11.RELEASE" | ||
} | ||
|
||
dependencies { | ||
compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | ||
compile("org.jetbrains.kotlin:kotlin-reflect") | ||
compile("org.springframework.boot:spring-boot-starter-web") | ||
compile("org.springdoc:springdoc-openapi-ui:1.6.8") | ||
|
||
compile("com.google.code.findbugs:jsr305:3.0.2") | ||
compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml") | ||
compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") | ||
compile("com.fasterxml.jackson.datatype:jackson-datatype-jsr310") | ||
compile("com.fasterxml.jackson.module:jackson-module-kotlin") | ||
compile("jakarta.validation:jakarta.validation-api") | ||
compile("jakarta.annotation:jakarta.annotation-api:2.1.0") | ||
|
||
testCompile("org.jetbrains.kotlin:kotlin-test-junit5") | ||
testCompile("org.springframework.boot:spring-boot-starter-test") { | ||
exclude(module = "junit") | ||
} | ||
} |
136 changes: 136 additions & 0 deletions
136
samples/server/petstore/kotlin-springboot-multipart-request-model/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>openapi-spring</artifactId> | ||
<packaging>jar</packaging> | ||
<name>openapi-spring</name> | ||
<version>1.0.0</version> | ||
<properties> | ||
<springdoc-openapi.version>1.6.8</springdoc-openapi.version> | ||
<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version> | ||
<jakarta-annotation.version>2.1.0</jakarta-annotation.version> | ||
<kotlin-test-junit5.version>1.6.21</kotlin-test-junit5.version> | ||
|
||
<kotlin.version>1.6.21</kotlin.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.7.15</version> | ||
</parent> | ||
<build> | ||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory> | ||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>kotlin-maven-plugin</artifactId> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<version>${kotlin.version}</version> | ||
<configuration> | ||
<compilerPlugins> | ||
<plugin>spring</plugin> | ||
</compilerPlugins> | ||
<jvmTarget>1.8</jvmTarget> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>compile</id> | ||
<phase>compile</phase> | ||
<goals> | ||
<goal>compile</goal> | ||
</goals> | ||
</execution> | ||
<execution> | ||
<id>test-compile</id> | ||
<phase>test-compile</phase> | ||
<goals> | ||
<goal>test-compile</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-maven-allopen</artifactId> | ||
<version>${kotlin.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-stdlib-jdk8</artifactId> | ||
<version>${kotlin.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-reflect</artifactId> | ||
<version>${kotlin.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<!--SpringDoc dependencies --> | ||
<dependency> | ||
<groupId>org.springdoc</groupId> | ||
<artifactId>springdoc-openapi-ui</artifactId> | ||
<version>${springdoc-openapi.version}</version> | ||
</dependency> | ||
|
||
<!-- @Nullable annotation --> | ||
<dependency> | ||
<groupId>com.google.code.findbugs</groupId> | ||
<artifactId>jsr305</artifactId> | ||
<version>${findbugs-jsr305.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-yaml</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.dataformat</groupId> | ||
<artifactId>jackson-dataformat-xml</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-jsr310</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.module</groupId> | ||
<artifactId>jackson-module-kotlin</artifactId> | ||
</dependency> | ||
<!-- Bean Validation API support --> | ||
<dependency> | ||
<groupId>jakarta.validation</groupId> | ||
<artifactId>jakarta.validation-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.annotation</groupId> | ||
<artifactId>jakarta.annotation-api</artifactId> | ||
<version>${jakarta-annotation.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jetbrains.kotlin</groupId> | ||
<artifactId>kotlin-test-junit5</artifactId> | ||
<version>${kotlin-test-junit5.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
15 changes: 15 additions & 0 deletions
15
samples/server/petstore/kotlin-springboot-multipart-request-model/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pluginManagement { | ||
repositories { | ||
maven { url = uri("https://repo.spring.io/snapshot") } | ||
maven { url = uri("https://repo.spring.io/milestone") } | ||
gradlePluginPortal() | ||
} | ||
resolutionStrategy { | ||
eachPlugin { | ||
if (requested.id.id == "org.springframework.boot") { | ||
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") | ||
} | ||
} | ||
} | ||
} | ||
rootProject.name = "openapi-spring" |
13 changes: 13 additions & 0 deletions
13
...kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/Application.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.openapitools | ||
|
||
import org.springframework.boot.runApplication | ||
import org.springframework.boot.autoconfigure.SpringBootApplication | ||
import org.springframework.context.annotation.ComponentScan | ||
|
||
@SpringBootApplication | ||
@ComponentScan(basePackages = ["org.openapitools", "org.openapitools.api", "org.openapitools.model"]) | ||
class Application | ||
|
||
fun main(args: Array<String>) { | ||
runApplication<Application>(*args) | ||
} |
17 changes: 17 additions & 0 deletions
17
...lin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/HomeController.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.openapitools | ||
|
||
import org.springframework.context.annotation.Bean | ||
import org.springframework.stereotype.Controller | ||
import org.springframework.web.bind.annotation.RequestMapping | ||
import org.springframework.web.bind.annotation.ResponseBody | ||
import org.springframework.web.bind.annotation.GetMapping | ||
|
||
/** | ||
* Home redirection to OpenAPI api documentation | ||
*/ | ||
@Controller | ||
class HomeController { | ||
|
||
@RequestMapping("/") | ||
fun index(): String = "redirect:swagger-ui.html" | ||
} |
26 changes: 26 additions & 0 deletions
26
...ngboot-multipart-request-model/src/main/kotlin/org/openapitools/SpringDocConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.openapitools | ||
|
||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
|
||
import io.swagger.v3.oas.models.OpenAPI | ||
import io.swagger.v3.oas.models.info.Info | ||
import io.swagger.v3.oas.models.info.Contact | ||
import io.swagger.v3.oas.models.info.License | ||
import io.swagger.v3.oas.models.Components | ||
import io.swagger.v3.oas.models.security.SecurityScheme | ||
|
||
@Configuration | ||
class SpringDocConfiguration { | ||
|
||
@Bean | ||
fun apiInfo(): OpenAPI { | ||
return OpenAPI() | ||
.info( | ||
Info() | ||
.title("MultipartFile test") | ||
.description("No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)") | ||
.version("1.0.0") | ||
) | ||
} | ||
} |
Oops, something went wrong.