当前位置:网站首页>Swagger key configuration items
Swagger key configuration items
2022-07-25 03:15:00 【Blue sky ⊙ white clouds】
1. Swagger in paramType
Swagger in paramType
paramType: Indicates where the parameter is placed
header–> Get request parameters :@RequestHeader( Receiving comments in code )
query–> Get request parameters :@RequestParam( Receiving comments in code )
path( be used for restful Interface )–> Get request parameters :@PathVariable( Receiving comments in code )
body–> Get request parameters :@RequestBody( Receiving comments in code )
form( Not commonly used )
demo_form:
@PostMapping(value = "add", headers = "content-type=multipart/form-data")
@ApiOperation(" Attachment saving interface ( Multi file upload is not supported swagger test )")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "*id", example = "10086", paramType = "form", required = true),
@ApiImplicitParam(name = "status", value = " Attachment status ", example = "3",
paramType = "form", allowableValues = "2,3", required = true)
})
public Result add(AddDTO addDTO,
@ApiParam(value = "* The attachment ") @RequestParam(value = "materialSigns", required = false)
MultipartFile[] file,
) {

2. dataType Set up
allowMultiple: Allow multiple , namely : Array or collection .
dataType: The element type of an array or collection , namely : Class name .
Annotation configuration of custom type
@ApiModel(value = "UserDto", description = " user ")
public class User implements Serializable {
//...
}
If the element type is native , Such as :int、String And so on. , There is no need for this step .
If the element type is a custom type , Such as :UserDto, This step is necessary , In order to swagger You can find the corresponding type of this element .
边栏推荐
- The dolphin scheduler calls the shell script and passes multiple parameters
- Read and upgrade st-link chip information and SWD burning media through STM32 stlink utility tool
- Operator explanation - C language
- Banana pie bpi-m5 toss record (2) -- compile u-boot
- B. Difference of GCDs
- Beginners must see the markdown User Guide
- Chrome process architecture
- Innobackupex parameter description
- Jenkins plug-in development -- plug-in expansion
- Common methods of array
猜你喜欢

JS written test question -- deep copy of object
![[Kali's sshd service is enabled]](/img/1b/180534d51049177254e30c4b783eba.png)
[Kali's sshd service is enabled]

Use of stm32cubemonitor part I - data plotting and instrument display

Experiment 4 CTF practice

Learning record 10

Decoding webp static pictures using libwebp

Use reflection to convert RDD to dataframe

Openlayers ol ext: Transform object, rotate, stretch, zoom in

New key points of ES6

Banana pie bpi-m5 toss record (3) -- compile BSP
随机推荐
Easyexcel sets the style of the last row [which can be expanded to each row]
Bgy development small example
mysql_ Create temporary table
Sum of "n" numbers of force deduction summary
Vulntarget vulnerability shooting range -vulntarget-b
Define macros in makefile and pass them to source code
DOM operation -- get elements and nodes
Unified return data format
FLASH read / write problem of stm32cubemx
Question B: shunzi date
hello csdn
Leetcode programming practice -- Tencent selected 50 questions (I)
Canvas record
Arduino + si5351 square wave generator
ES6 - study notes
B. Difference of GCDs
Experiment 4 CTF practice
Riotboard development board series notes (VIII) -- building desktop system
Chrome process architecture
List title of force buckle summary