What problem does it solve?
This skill helps developers integrate @inaiat/fastify-papr into Fastify services, enabling typed Papr models, type augmentation for FastifyPapr, and robust handling of MongoDB schema validation errors.
Core Features & Use Cases
- Type-safe model registration: Register Papr models with asCollection and access them via fastify.papr, supporting single-database and multi-database setups.
- Type augmentation patterns: Declare and augment the FastifyPapr interface to reflect your app's model surface and connection structure.
- Validation error handling: Use MongoDB validation helpers such as isMongoServerError and extractValidationErrors to return structured error details.
- Runtime and packaging guidance: Follow the ESM-only runtime constraints and recommended dependency layout for reliable operation.
Quick Start
Install the plugin, register fastify-mongodb first, then register @inaiat/fastify-papr with your Db and asCollection models.