restdocs validation

    REST Docs에 DTO Bean Validation 담기

    Bean Validation 사용시 Validation 정보를 담기 위한 커스텀 템플릿과 ConstraintDescriptions을 이용해서 Bean Validation 정보를 가져오는 방법에 대해 알아보자. 1. 커스텀 템플릿 만들기 스니펫 템플릿을 커스텀한다. test/resources/org/springframework/restdocs/templates/request-fields.snippet 파일 // request-fields.snippet ===== Request Fields |=== |필드명|타입|설명|필수값|Constraints {{#fields}} |{{#tableCellContent}}`+{{path}}+`{{/tableCellContent}} |{{#tableCellContent}}`..