What problem does it solve?
Mementifier standardizes and secures the serialization of ColdBox/BoxLang ORM entities and model objects into plain structs suitable for JSON API responses, avoiding accidental exposure of sensitive fields and enabling computed and relationship-driven properties.
Core Features & Use Cases
- Selective Serialization: Configure defaultIncludes and defaultExcludes to control the default output surface for API responses.
- Security by Default: Permanently hide sensitive fields using neverInclude so passwords, tokens, and internal flags are never exposed.
- Computed & Relationship Fields: Define mappers for virtual or computed properties and serialize related entities with controlled depth or custom mappers.
- Named Profiles: Create multiple profiles (public, admin, api) to serve different audiences from the same entity.
- Use Case: Build a public REST endpoint that returns minimal user data while an admin endpoint returns richer metadata using named profiles and mappers.
Quick Start
Use mementifier by configuring this.memento on your entity with defaultIncludes and neverInclude, then call getMemento() in your handler to render JSON-safe structs.