39 lines
692 B
Markdown
39 lines
692 B
Markdown
# 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
|