refactor: 분석 상태를 열거형 그대로 응답에 싣기 - #129
Merged
Merged
Conversation
목록의 analysis_status 가 String 이라 생성된 스펙에 type: string 으로만 나갔다. 허용값 여섯 개는 스키마 설명 문구에만 있어 클라이언트가 눈으로 읽고 옮겨 적어야 했고, 값이 늘거나 이름이 바뀌어도 스펙은 그대로라 어긋난 것이 드러나지 않았다. 열거형을 이름으로 바꾸던 단계를 없애 허용값의 출처를 AnalysisJobStatus 하나로 둔다. 직렬화 결과는 이름 그대로라 응답 JSON 은 바뀌지 않는다.
기대값을 AnalysisJobStatus 에서 직접 뽑는다. 테스트에 여섯 값을 적어두면 그 목록이 두 번째 출처가 되어 애초에 없애려던 문제를 되풀이한다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈
변경 내용
analysis_status를 열거형 타입으로 선언해 OpenAPI 스펙에enum으로 노출ListTreatmentRecordsUseCase.Item· 서비스)작업 목적
허용값이 스키마 설명 문구에만 있어 클라이언트가 코드 생성으로 타입을 받지 못하고 손으로
옮겨 적어야 했다. 값이 늘거나 이름이 바뀌어도 스펙은 그대로라 어긋난 것이 드러나지 않는다.
테스트 방법
응답 JSON 은 바뀌지 않는다. 값 자체를 검증하는 기존 목록 API 통합 테스트가
수정 없이 그대로 통과하는 것이 그 근거다.
체크리스트
기타 사항
Item이 분석 도메인의 열거형을 참조한다. 두 타입 모두domain안이고 계층 규칙이금지하지 않으며, 서비스는 이미 같은 타입을 다루고 있었다 — 경계를 넘은 것이 아니라
이름으로 바꿔 들고 다니던 우회를 없앤 것이다.
"분석 완료"는SUCCEEDED만 해당한다는 점을 스키마 설명에 명시했다. 사진이 바뀌면STALE로 전이되므로 결과가 남아 있다는 것과 완료라는 것은 같지 않다.