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

[FO-1037] sql in 문에 값이 없는 경우 true으로 변환되는 문제 픽스 #434

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

DoodlesOnMyFood
Copy link
Collaborator

기존 dsl의 in문의 value 값이 [] 인 경우 해당 true로 치환되어 의도와 다르게 결과가 나오는 경우가 발생.

예시:

get /api/v1/profiles?type=ACTOR&domains=PAINTING

해당 경우 PAINTING 도메인을 가진 프로필이 존재하지 않은 경우 응답 값으로 []이 아웃풋인게 기대값이나

get /api/v1/profiles?type=ACTOR

와 같은 값을 돌려줌.

…ues는 빈 List가 주어진 경우 false으로 되도록 구현
Copy link
Contributor

@sinkyoungdeok sinkyoungdeok left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 요즘 바빠서 신경을 못쓰고있네요.

이거 jdsl 버그 인거죠?
querydsl 안쓴지 좀 돼서 기억이 잘 안나는데, querydsl에서는 비슷한 이슈 없었던 것 같아서요~

Copy link
Contributor

Choose a reason for hiding this comment

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

DslConfig 대신 jdslExt 같은 네이밍은 어떨까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

네 좋습니다

import com.linecorp.kotlinjdsl.query.spec.predicate.InValueSpec
import com.linecorp.kotlinjdsl.query.spec.predicate.PredicateSpec

class DslConfig
Copy link
Contributor

Choose a reason for hiding this comment

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

요거 lint때문에 추가한거죠?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아 아뇨, 원래 인터페이스 갖고 뭐하려다가 지웠는데 깜빡한 모양입니다.

// values가 없으면 항상 false이도록
return EqualValueSpec(LiteralSpec(1), 0)
}
return InValueSpec(this, values)
Copy link
Contributor

Choose a reason for hiding this comment

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

이런 함수는 어떻게 찾으셨나여?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

kotlin-jdsl 라이브러리 코드 보고 적당히 원하는 부분 합쳤습니다.

@github-actions github-actions bot requested a review from sinkyoungdeok April 24, 2024 10:54
Copy link
Contributor

@sinkyoungdeok sinkyoungdeok left a comment

Choose a reason for hiding this comment

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

👍

@DoodlesOnMyFood DoodlesOnMyFood merged commit 20f8bd0 into main Apr 25, 2024
3 checks passed
@DoodlesOnMyFood DoodlesOnMyFood deleted the FO-1037 branch April 25, 2024 12:08
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.

2 participants