백엔드-프론트엔드 데이터 변환(Data Transformation between Backend and Frontend)
10_Wiki/Topics
verified
self
DTO
Data Transformation
API 응답 변환
snake_case to camelCase
none
A
0.9
applied
frontend
backend
api
data-modeling
typescript
2026-05-10
pending
language
framework
typescript
react
백엔드-프론트엔드 데이터 변환(Data Transformation between Backend and Frontend)
매 한 줄
"매 server payload 매 client model 의 일치 안함 — adapter 의 boundary". 매 DB schema (snake_case, nullable, denormalized) 매 UI model (camelCase, optional, normalized)의 mismatch 의 explicit 의 mapping. 매 2026 의 Zod + tRPC + GraphQL codegen 의 type-safe automation.
매 핵심
매 mismatch dimensions
Naming: user_name (snake) ↔ userName (camel).
Types: 1693497600 (Unix epoch) ↔ Date object, "2026-05-10" ↔ Date.
언제: API integration, form submission, type-safe full-stack, validation at trust boundary.
언제 X: 매 internal tool 의 untyped — 매 still validate 매 trust boundary.
❌ 안티패턴
Trust the API blindly: validate 매 trust boundary — server bug, version mismatch breaks UI silently.
Transform 의 component-level: scatter mapping logic — centralize at fetch layer.
any types: defeats TS — Zod infer 의 type derivation.
Date as string in app code: lose type safety — parse to Date at boundary.
Manual mapping 의 100 fields: codegen 의 use.
🧪 검증 / 중복
Verified (Zod docs, tRPC docs, Martin Fowler "Patterns of Enterprise Application Architecture").
신뢰도 A.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — full content with Zod/tRPC/Codegen patterns