2024-06-12

This commit is contained in:
2024-06-12 13:11:58 +09:00
parent d2bb77ca33
commit a75a1dbd0f
31 changed files with 263 additions and 7 deletions

View File

@@ -0,0 +1,38 @@
# Swagger
## 설정
### 의존성 추가
```kotlin
implementation("io.springfox:springfox-swagger2:2.9.2")
implementation("io.springfox:springfox-swagger-ui:2.9.2")
```
### 설정 코드 추가
```java
import jdk.javadoc.doclet.Doclet;
import java.beans.BeanProperty;
@Configuration
@EnableSwagger2
public class MyConfiguration {
@Bean
public Doclet api(){
return new Docket(DocumentationType.SWAGGER_2)
...
.build();
}
}
```
## 어노태이션
* @ApiOperation : 해당 API에 대한 설정을 작성합니다.
* value
* notes
* @ApiParam : 해당 API의 매개변수에 대한 설명 및 설정을 지정합니다.
* value
* required