Tag Archives: swagger

[펌글] SpringDoc (swagger 생성기) 을 노출하지 않기 (운영환경에서 필요할 듯)

By | 7월 4, 2022

Hi, This feature will be added on v1.2.12, of springdoc-openapi. This property helps you disable only the ui. springdoc.swagger-ui.enabled=false The following property, will help you disable the api-docs Rest endpoints as well: springdoc.api-docs.enabled=false 출처 https://github.com/springdoc/springdoc-openapi/issues/191

json 출력 혹은 swagger 문서에서 VO객체의 일부 필드(멤버) 숨기기 (Spring 4, jackson2, springfox 2.9 환경)

By | 6월 30, 2021

@ApiModelProperty(notes = "책 썸네일 atchFileId", hidden = true) @JsonIgnore private String bookThumbnailFileId; swagger의 모델 정의에서 필드 숨기기 @ApiModelProperty를 아예 필드에 붙이지 않는다. 모종의 이유로 붙였을 경우에는 @ApiModelProperty(hidden = true)를 사용한다. json response 에서 필드 숨기기 @JsonIgnore 를 사용한다. @JsonIgnore는 꼭 com.fasterxml.jackson.annotation.JsonIgnore 을 사용해야 한다. (java 패키지 확인)