Add valibot for parameter validation in /post#539
Conversation
|
I'd like to see if there's a way to solve this together inside #538. Let us discuss a little more before proceeding with this because doing the same validation twice feels very wrong to me. |
|
「2回やる」の意味がわからない,このPRは単に params のバリデーションをしているだけで,#538 とは関係がないし,一緒にやる理由も無いと思う. |
|
It's being validated another time when it arrives on the backend (which is where it actually matters) -- at which point the error should be able to be forwarded if needed (hence this ties into #538). In 100% of the cases the logic is the exact same. I currently think we should not be introducing more code for this in the metaframework. There are areas where we still might want to do more checks such as display params, so let's spend a bit more time discussing this before going forward. |
|
今回はそのケースではないが,私見では以下を修正していきたい.
|
|
|
今回の修正のケースではないが,例えばのケースとして バックエンド側の制約条件と厳密に合わせる必要はなく,型として有用な程度の最小限の制約条件で良いのでそれほどコストはかからないと思う. |
|
I'm going to veto this for now. The complexity is low for that kind of check and doesn't warrant an entire validation library. Two or three helpers our own can make this ergonomic enough. I'm still not convinced about pre-flight checks. |
|
そもそも型以前の問題としてJSとPythonで意味論が違う以上,2x-checkだとしても最低限のvalidationは入れるべきだと思い直してきた. |
|
I don't agree. I suggest that you talk to us about this before working on this since it would otherwise be vetoed again. |
方針としてはこのようなvalidatorを入れてsearchParamsをチェックする.段階的にやるので,とりあえず1ページのみ.