Whatever message this page gives is out now! Go check it out!

ColdFusion AI framework schema reference

Last update:
May 18, 2026
Look up supported schema types, validation error messages, and provider feature support for the ColdFusion AI framework JSON schema guardrail system.

Supported primitive types

The three supported type strings and their ColdFusion validation equivalents.
Type stringAcceptsColdFusion equivalent
"String"Any text valueisSimpleValue()
"Number"Integer or decimalisNumeric()
"Boolean"true / falseisBoolean()
Type strings are case-insensitive. "String", "string", "STRING", and "sTrInG" are all equivalent.

Optional fields

Append a ? suffix to mark a field as optional. The model includes it when the information is available and omits it when it is not. The ? suffix works on nested struct fields too.
SCHEMA: {
    "city":       "String",    // required
    "country":    "String",    // required
    "population": "Number",    // required
    "mayor":      "String?",   // optional
    "elevation":  "Number?"    // optional
}

Nested object support

Nest a CF struct inside the schema to describe a nested JSON object. Nesting up to five levels deep is verified to work. Anthropic has the best reliability for three or more levels of nesting.
SCHEMA: {
    "company": "String",
    "headquarters": {
        "country": "String",
        "office": {
            "floor": "Number",
            "room":  "String"
        }
    }
}

Array support

Wrap a single-element CF array around a type string or struct to describe an array field. An array schema value must contain exactly one element — an empty array or multi-element array throws before any API call is made.
// Array of primitives
SCHEMA: { "team": "String", "members": ["String"] }

// Array of objects
SCHEMA: {
    "class":    "String",
    "students": [{ "name": "String", "grade": "Number", "pass": "Boolean" }]
}

Unsupported types

These type strings throw an Expression error immediately; use the alternatives shown.
Rejected typeUse instead
"Date""String" (specify the format in the prompt)
"Object"Nested struct { ... }
"Double""Number"
"Float""Number"
"Int""Number"

Schema validation errors

Errors thrown by the framework before any API call is made, with causes and fixes.
Error message (partial)CauseFix
"cannot be null or empty"SCHEMA: {} — empty structAdd at least one field to the schema
"valid ColdFusion struct"SCHEMA is not a structPass a CF struct
"SYSTEMMESSAGE or USERMESSAGE"Neither message key presentAdd USERMESSAGE or a system message
"did not complete"Unsupported type nameReplace with "String", "Number", or "Boolean"
"exactly one element"Array schema has 0 or 2+ elementsUse exactly one element: ["String"] or [{...}]

Runtime response anomalies

Response conditions to check in your code — not thrown by the framework.
SymptomCheckRecovery
response.message is emptylen(trim(text)) == 0Retry or return a default value
Response is not JSON!isJSON(text)Log the raw text and return an error
Required field missing!structKeyExists(parsed, field)Flag for review; use a default value
Wrong type for a field!isNumeric(parsed.age)Cast the value or flag it as invalid
Array is emptyarrayLen(parsed.items) == 0Retry with a more explicit prompt hint

Provider compatibility matrix

Feature support across all providers
FeatureAnthropicOpenAIAzure OpenAIGeminiMistralOllama
Flat schema
Nested struct
String array
Number array
Object array
Optional fields (?)
System message
Deep nesting (5+ levels)
temperature: 0
Requires ResponseFormat
Requires BASEURL
The schema validation rules, type rejection and array arity checks, apply uniformly regardless of provider. For provider setup code, see configure AI providers with schema guardrails.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page