내 REST API를 문서화하기 위해 swagger를 사용하고 있습니다.swagger가 API 모델 값을 생성하지 않습니다.
문서를 자동 생성하지 않으므로 주석이있는 swagger-jaxrs를 사용하고 있습니다.
@GET
@Path("/news/{id}")
@Produces(MediaType.APPLICATION_JSON)
@ApiResponses(value = {
@ApiResponse(code = 200, message = "News found", response = NewsEntry.class)})
NewsEntry 내 모델이며, 그 다음으로 잘 살고 있어요 :
@ApiModel("News Entry")
public class NewsEntry {
@ApiModelProperty(value = "the id of the item", required = true)
private static long id;
@ApiModelProperty(value = "content", required = true)
private static String content;
}
을 몇 가지 검사 후에, 나는 NewsEntry의 게터/세터가없는 경우, 그렇지 않은 것을 발견 충돌, 그러나, 그것은 빈 모델을 생성 ... 내가 뭘 잘못하고 있는지 어떤 생각?
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey-jaxrs</artifactId>
<version>1.5.0</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.8 </version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-core</artifactId>
<version>1.5.8 </version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
<version>1.5.8 </version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.8 </version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>2.1.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.1.4.Final</version>
</dependency>