Mishka
/
PRODUCTS Mishka CMS Multi-tenant, real-time CMS Chelekom Phoenix UI components + CLI Gervaz Admin DSL for Ash Installer Plugin & event manager on OTP Guarded Struct Validated, sanitized structs
CMS EXTENSIONS Blog Multi-author publishing Documentation Versioned, reviewed docs Migration Other CMSs to Mishka CMS MISHKA All docs Blog Hire us Sponsor
/ Guarded Struct
docs
Overview
GitHub ↗
Overview
Mishka CMS Multi-tenant, real-time CMS Chelekom Phoenix UI components + CLI Gervaz Admin DSL for Ash Installer Plugin & event manager on OTP Guarded Struct You are here CMS · Blog Multi-author publishing CMS · Documentation Versioned, reviewed docs CMS · Migration Other CMSs to Mishka CMS
Home All docs Blog Hire us Sponsor
GitHub ↗
Drawer content

Contents

  • Get Started
  • How-to guides
  • Nest structs with sub_field
  • Accept more than one shape with conditional_field
  • Fill and check fields from other fields
  • Use virtual, dynamic and pattern-keyed fields
  • Write a field validator and a main validator
  • Add your own derive ops
  • Validate input without building a struct
  • Handle and translate errors
  • Inspect, diff and observe structs
  • Use GuardedStruct in an Ash resource
  • Give your coding agent the GuardedStruct rules
  • Concepts
  • How the builder works
  • How derives work
  • Reference
  • DSL reference
  • Derive string syntax
  • Sanitize ops
  • Validate ops
  • API reference
  • Error shapes and actions
  • Configuration
  1. GuardedStruct
Reference

Reference

Updated Nov 9, 2026 · v0.1.6

The reference pages list the facts of GuardedStruct: every DSL option, the derive string syntax, the built-in sanitize and validate ops, the API of each module, the error shapes and actions, and the configuration keys, packages and message callbacks.

  • DSL reference Every option of the guardedstruct section and of field, virtual_field, dynamic_field, sub_field and conditional_field in GuardedStruct.
  • Derive string syntax Everything a derive string can contain: groups, op forms, enum and equal operands, regex patterns, combinators, and the checks made at compile time.
  • Sanitize ops All 23 built-in sanitize ops of GuardedStruct: text, HTML, number, list and default ops, with what each one does to a value.
  • Validate ops All 65 built-in validate ops of GuardedStruct: types, size, format, date and combinator ops, with what each accepts and the packages some need.
  • API reference Functions generated on a guarded module, and the public modules Validate, Info, Diff, Errors, Extension and AshResource, with telemetry events.
  • Error shapes and actions The shapes of GuardedStruct error maps and every action, such as required_fields, dependent_keys, conditionals and type, with default messages.
  • Configuration Configure GuardedStruct with config keys and the options you pass to use GuardedStruct, and see its optional packages and error message callbacks.
Previous How derives work
Next DSL reference
0.1.6
  • 0.1.6 latest
  • 0.1.5
  • 0.1.4
  • 0.1.3
Report issue
On this page
Drawer content