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

Context params 처리 로직 개선 (#10) #11

Merged

Conversation

Seokyoung-Hong
Copy link
Collaborator

@Seokyoung-Hong Seokyoung-Hong commented Dec 16, 2024

해당 PR은 #10 이슈를 해결하기 위한 Context의 params 처리 로직 및 코드 일관성 개선사항을 포함합니다.

주요 변경사항

  • Payload와 Response에서 서로 다른 형식으로 전달되는 params 필드 처리 로직 개선
    • Payload: params={"key": {"value":"value","resolved_value":"resolved_value"}}
    • Response: params={"key":"value"}
  • ContextParam 클래스를 도입하여 Payload에서 전달되는 params를 변환하고, Response에서는 value만 반환하도록 개선
  • validate() 메서드에서 ContextParam 객체 유효성 검사 추가

위 변경으로 Payload와 Response 간 params 구조 불일치 문제를 해결하고, 코드 가독성과 일관성을 높였습니다.

Context의 params 필드가 Payload와 Response에서 서로 다른 형태로 전달되는 문제를 해결합니다.
기존에는 단순한 key-value 문자열 맵핑으로 처리했으나, 이번 수정으로 Payload에서 전달되는
JSON 형태의 params를 ContextParam 객체로 변환하고, Response에서는 해당 객체를 단순 value만
반환하도록 함으로써 구조 불일치를 해소했습니다.

- Payload 예: params={"key": {"value":"value","resolved_value":"resolved_value"}}
- Response 예: params={"key":"value"}

ContextParam 클래스를 활용해 이러한 파라미터 변환 로직을 추가하고, Context 클래스의
from_dict, render 메서드 로직을 개선했습니다.
@Seokyoung-Hong Seokyoung-Hong added bug Something isn't working patch Label for a patch update pull request labels Dec 16, 2024
@Seokyoung-Hong Seokyoung-Hong merged commit 21fb76e into hanlee55:main Jan 8, 2025
@Seokyoung-Hong Seokyoung-Hong removed the bug Something isn't working label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Label for a patch update pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant