mementifier

Serialize ColdBox and BoxLang ORM entities into JSON-safe structs.

1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ColdBox/skills --skill mementifier
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mementifier
Source: https://github.com/ColdBox/skills/tree/main/modules/mementifier
Command: npx skills add https://github.com/ColdBox/skills --skill mementifier

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about mementifier

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely serialize ColdBox ORM entities to JSON without exposing sensitive fields?

Safely serialize ColdBox ORM entities by configuring this.memento with defaultIncludes and neverInclude to permanently hide sensitive fields like passwords and tokens from JSON API responses. Use getMemento() in your handler to render the secure struct.

Can I create different JSON serialization profiles for the same ColdBox entity?

Create multiple named profiles like public, admin, and api within this.memento to serve different audiences from the same ColdBox entity. Each profile controls exposed properties, allowing a public endpoint to return minimal data while an admin endpoint returns richer metadata.

How do I include computed fields and relationship data when serializing ColdBox objects?

Include computed fields and relationship data by defining mappers in this.memento for virtual properties and related entities. Control relationship depth and apply custom mappers to manage how nested ORM relationships are serialized into your JSON output.

What's the best way to standardize REST API serialization for ColdBox and BoxLang models?

Standardize REST API serialization by applying mementifier to map ColdBox and BoxLang ORM model objects into plain structs. Configure defaultIncludes, defaultExcludes, and mappers to ensure consistent, safe production patterns across all your API response handlers and services.

Does mementifier work with WireBox objects and custom mappers?

Mementifier works with ColdBox entities and WireBox objects, allowing you to control exposed properties through custom mappers. Configure mappers within this.memento to transform virtual or computed properties before rendering the final JSON-safe struct output.