prisma-json-field-api-serialization
CommunityFix Prisma REST field type serialization errors instantly.
Authorfreedomw1987
Version1.0.0
Installs0
System Documentation
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.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: prisma-json-field-api-serialization Download link: https://github.com/freedomw1987/tree_monstor/archive/main.zip#prisma-json-field-api-serialization Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 536,000+ vetted skills library on demand.