-
Notifications
You must be signed in to change notification settings - Fork 0
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
Schema Validation Layer | Blog by pumpkiinbell #8
Comments
https://www.pumpkiinbell.com/blog/remote/scheme-validation-layer#parse 에서 궁금한것이 있는데 아래 코드에서 어떻게 id 키를 필터링 할 수 있는건가요? type Something = z.infer<typeof Something>;
const Something = z.object({
id: z.string();
name: z.string();
content: z.string();
})
function fetchSomething(payload: Something) {
const newPayload = Something.parse(payload);
// do something...
} |
정리 너무 잘해주셔서 이해가 쏙쏙 되네요 ㅎㅎ |
@gomjellie type Something = z.infer<typeof Something>;
const Something = z.object({
- id: z.string();
name: z.string();
content: z.string();
})
function fetchSomething(payload: Something) {
const newPayload = Something.parse(payload);
// do something...
} |
Backend 개발할 때 Fastify의 AJV로 payload body 검증하는 사례를 봤을 때 굉장히 편한 도구가 많이 나왔다고 생각했는데 이 글을 보고나니 Frontend 사이드도 굉장히 진보되었다는 것을 새삼느끼네요!! 👏 좋은 글 잘 읽었습니다. :)))) |
잘읽었습니다 감사합니다~ |
좋은글 감사합니다~ |
너무너무 좋은 글 입니다! |
Schema Validation Layer | Blog by pumpkiinbell
평소 API 반환값을 추론하기 위해 어떤 방식을 사용하시나요? Schema Validation Layer 를 추가하면 메인 로직을 깔끔하게 관리할 수 있습니다.
https://www.pumpkiinbell.com/blog/remote/scheme-validation-layer
The text was updated successfully, but these errors were encountered: