-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 328 added removal of @RequestBody anotation when requestBody is multipart/form-data and created MultiPartFile type --------- Co-authored-by: Óscar Ares Bascón <oscar.ares@sngular.com>
- Loading branch information
1 parent
94941e5
commit 74d836e
Showing
16 changed files
with
178 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
4 changes: 2 additions & 2 deletions
4
multiapi-engine/src/main/java/com/sngular/api/generator/plugin/common/tools/MapperUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
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
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
29 changes: 29 additions & 0 deletions
29
...i-engine/src/test/resources/openapigenerator/testFormDataMultipartGeneration/api-test.yml
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,29 @@ | ||
openapi: 3.0.2 | ||
info: | ||
title: Testing example file | ||
version: 1.0.0 | ||
servers: | ||
- url: http://localhost/v1 | ||
paths: | ||
/test: | ||
get: | ||
tags: | ||
- test | ||
operationId: testMultipart | ||
requestBody: | ||
required: true | ||
content: | ||
multipart/form-data: | ||
schema: | ||
type: object | ||
properties: | ||
someString: | ||
type: string | ||
someFile: | ||
type: string | ||
format: binary | ||
|
||
responses: | ||
'200': | ||
description: | ||
OK |
46 changes: 46 additions & 0 deletions
46
...e/src/test/resources/openapigenerator/testFormDataMultipartGeneration/assets/TestApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.sngular.multifileplugin.testformdatamultipartgeneration; | ||
|
||
import java.util.Optional; | ||
import java.util.List; | ||
import java.util.Map; | ||
import javax.validation.Valid; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
import org.springframework.web.context.request.NativeWebRequest; | ||
|
||
import com.sngular.multifileplugin.testformdatamultipartgeneration.InlineObjectTestMultipart; | ||
|
||
public interface TestApi { | ||
|
||
/** | ||
* GET /test | ||
* @param inlineObjectTestMultipart (required) | ||
* @return OK; (status code 200) | ||
*/ | ||
|
||
@Operation( | ||
operationId = "testMultipart", | ||
tags = {"test"}, | ||
responses = { | ||
@ApiResponse(responseCode = "200", description = "OK") | ||
} | ||
) | ||
@RequestMapping( | ||
method = RequestMethod.GET, | ||
value = "/test", | ||
produces = {"application/json"} | ||
) | ||
|
||
default ResponseEntity<Void> testMultipart(@Parameter(name = "inlineObjectTestMultipart", description = "", required = true, schema = @Schema(description = "")) @Valid InlineObjectTestMultipart inlineObjectTestMultipart) { | ||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); | ||
} | ||
|
||
} |
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
Oops, something went wrong.