Skip to content

[#12] 응답 검증과 디코딩 파이프라인을 구성한다#21

Merged
opficdev merged 5 commits into
developfrom
feat/#12-response&decoding
Apr 13, 2026
Merged

[#12] 응답 검증과 디코딩 파이프라인을 구성한다#21
opficdev merged 5 commits into
developfrom
feat/#12-response&decoding

Conversation

@opficdev
Copy link
Copy Markdown
Owner

🔗 연관된 이슈

📝 작업 내용

📌 요약

  • 응답 검증 파이프라인 구현
  • 응답 디코딩 파이프라인 구현
  • 응답 에러 매핑 파이프라인 구현
  • 응답 검증과 디코딩 파이프라인 테스트 구현

🔍 상세

  • 응답 검증 파이프라인 구현
    • NXResponsePipeline.validate(...) 추가
    • 상태코드 검증 로직 구현
    • NXServerErrorDecoder 우선 적용 후 NXError.server 또는 NXError.invalidStatus 반환
  • 응답 디코딩 파이프라인 구현
    • NXResponsePipeline.decode(...) 추가
    • JSONDecoder 기반 모델 디코딩
    • 디코딩 실패 시 NXError.decoding으로 변환
  • 응답 에러 매핑 파이프라인 구현
    • NXResponsePipeline.map(...) 추가
    • NXError passthrough
    • URLError를 timeout/cancelled/transport로 매핑
    • 기타 에러를 NXError.unknown으로 매핑
  • 테스트 추가
    • NXResponsePipelineTests
    • 허용 상태코드 검증
    • 서버 에러 디코더 우선 적용 검증
    • 디코딩 성공/실패 검증
    • 에러 매핑 검증

테스트

  • swift test 통과

📸 영상 / 이미지 (Optional)

image

@opficdev opficdev self-assigned this Apr 13, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 풀 리퀘스트는 응답 검증, 디코딩 및 에러 매핑을 처리하는 NXResponsePipeline 로직과 관련 테스트 코드를 추가합니다. 테스트 코드에서 do-catchIssue.record를 사용하는 대신 Swift Testing 프레임워크의 #expect(throws:) 구문을 활용하여 에러 검증 로직을 더 간결하고 명확하게 개선할 것을 권장합니다.

Comment thread Nexa/Tests/NexaTests/NXResponsePipelineTests.swift Outdated
Comment thread Nexa/Tests/NexaTests/NXResponsePipelineTests.swift Outdated
@opficdev opficdev merged commit a8b4b95 into develop Apr 13, 2026
4 checks passed
@opficdev opficdev deleted the feat/#12-response&decoding branch April 13, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

응답 검증과 디코딩 파이프라인을 구성한다

1 participant