What problem does it solve?
Prisma serializes Json, Decimal, BigInt, DateTime, and Bytes fields as strings over REST APIs, causing runtime errors like type mismatches, failed test assertions, and method crashes when consumer code expects the native JavaScript type for these fields.
Core Features & Use Cases
- Per-type conversion patterns: Provides explicit, safe coercion logic for each affected Prisma field type to resolve common errors like "options.map is not a function" for Json fields, Decimal/BigInt equality mismatches, and Date method crashes.
- Multi-context support: Includes fixes for TypeScript frontend code, E2E test suites (Playwright/API tests), and API response normalization layers.
- Prevention guidance: Offers best practices for API design and test writing to avoid these serialization issues entirely, plus a verification recipe to inspect actual API response types.
- Use case example: If your E2E test fails because a Prisma Decimal field returns "2.5" as a string instead of the number 2.5, this skill provides the correct Number() coercion pattern to fix the assertion without losing precision.
Quick Start
Apply the correct per-field conversion patterns to fix Prisma REST serialization type mismatches for Json, Decimal, BigInt, DateTime, and Bytes fields in your API responses and test code.