Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validate perform request #35

Closed
2 tasks done
jeonghomoon opened this issue Sep 30, 2022 · 0 comments · Fixed by #36
Closed
2 tasks done

validate perform request #35

jeonghomoon opened this issue Sep 30, 2022 · 0 comments · Fixed by #36
Assignees
Labels
feat 기능 추가

Comments

@jeonghomoon
Copy link
Owner

jeonghomoon commented Sep 30, 2022

Description

개요

  • 앞선 PR에서 언급한 내용과 같이 401을 포함한 4XX의 응답 코드를 가진 응답에 대해 Intercept를 못하는 문제가 있습니다.
  • 이를 해결하기 위해 Alamofire의 validate 메소드를 이용하여 Intercept를 할 수 있도록 통신간 에러를 유발하려 합니다.

요구사항

  1. Alamofire의 validate 메소드를 사용하여 200..<300 이외의 응답 코드를 가진 경우에 대해 에러를 만들어줘야 합니다.
  2. responseDecodable 메소드를 responseData 메소드로 변경하여 result가 아닌 data, error의 유무에 따라 핸들링 해야합니다.

TODO

  • validate
  • responseData

Environment

macOS: Monterey 12.5.1, Apple M1
iOS: 15.5, iPhone 13 mini
IDE: Xcode 13.4.1

Related: #11 #33 #34

@jeonghomoon jeonghomoon added the feat 기능 추가 label Sep 30, 2022
@jeonghomoon jeonghomoon self-assigned this Sep 30, 2022
jeonghomoon added a commit that referenced this issue Oct 1, 2022
validate
- 200..<300 범위 내에 응답 상태 코드가 존재하는지 판별하고,
  Content-Type가 Accept 헤더와 일치하는 확인하는 유효성 검증 로직 추가

responseData
- 응답 처리 메소드를 responseData로 변경하여 acceptable하지 않은 상태코드를 가진 응답이더라도
  데이터와 상태코드 자체가 존재하는 경우 실패의 응답 인터페이스로 디코딩하는 로직으로 수정

Refs: #35
jeonghomoon added a commit that referenced this issue Oct 2, 2022
validate
- 200..<300 범위 내에 응답 상태 코드가 존재하는지 판별하고,
  Content-Type가 Accept 헤더와 일치하는 확인하는 유효성 검증 로직 추가

responseData
- 응답 처리 메소드를 responseData로 변경하여 acceptable하지 않은 상태코드를 가진 응답이더라도
  데이터와 상태코드 자체가 존재하는 경우 실패의 응답 인터페이스로 디코딩하는 로직으로 수정

Refs: #35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능 추가
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant