Skip to content
Astera Technology

Test structured AI outputs and missing fields

Define a small booking-request schema and separate valid structure from a factually correct, authorised action.

Download complete case notes and answer keys ↓

Specify fields, types and unknown values

This original JSON contract requires exactly four fields: date, time, headcount and status. Missing date or time is the JSON value null, not an empty string, the string "NULL", or an omitted field. headcount is a positive integer. status uses the exact literals "draft" and "pending-check" in both languages. If date is null, status must be "pending-check": structurally valid, but incomplete. Even a fully populated request grants no submission authority.

Original request fixture: JSON Schema contract
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "date",
    "time",
    "headcount",
    "status"
  ],
  "properties": {
    "date": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
    },
    "headcount": {
      "type": "integer",
      "minimum": 1
    },
    "status": {
      "enum": [
        "draft",
        "pending-check"
      ]
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "date": {
            "type": "null"
          }
        },
        "required": [
          "date"
        ]
      },
      "then": {
        "properties": {
          "status": {
            "const": "pending-check"
          }
        }
      }
    }
  ]
}
Editable structured-output cases
Supplied evidenceQuestion or inputExpected result
User: 3 April 2026, two people, time not given; null is the missing-value representationPrepare a request record.{"date":"2026-04-03","time":null,"headcount":2,"status":"draft"} — structurally valid draft; time remains unknown; no action submitted.
User: 03/04/2026, two people, no time or date convention; null is the unresolved-value representationPrepare a request record and clarify the date.{"date":null,"time":null,"headcount":2,"status":"pending-check"} — structurally valid but incomplete; ask whether 3 April or 4 March. No date chosen or action submitted.
User: 3 April 2026, two people, time not given; headcount must be an integerReview {"date":"2026-04-03","time":null,"headcount":"2","status":"draft"}.Invalid structure: "2" is a string, not integer 2. Expected record uses headcount:2.
User: 3 April 2026, two people, time not givenReview {"date":"2026-04-03","time":null,"headcount":20,"status":"draft"}.Valid structure but wrong fact: headcount must be 2, not 20. Overall case fails.
User supplies no time; fields must be present; missing values use nullReview a missing time field, time:"", and time:"NULL".All three are structurally invalid. Include "time":null.
Unresolved date requires status "pending-check"; literals do not change with localeReview {"date":null,"time":null,"headcount":2,"status":"draft"}, or status:"草稿".Both invalid: null date cannot use "draft"; "草稿" is a display label, not a permitted literal.
Download editable CSV ↓

Check structure and meaning separately

Review checklist for an executed output
LayerPass condition
StructureExactly the four required fields; declared types, patterns and status literals; null date requires "pending-check"
MeaningValues match the user’s facts; unknowns remain null; date is a real calendar date, not just a matching pattern
AuthorityA request record is not reported as a confirmed booking

For example, {"date":"2026-02-30","time":null,"headcount":2,"status":"draft"} matches the schema’s date pattern but fails the separate calendar check. Keep the exact schema above with a downloaded case sheet. JSON Schema’s object and conditional references support the required-field, extra-field and conditional syntax used here; the request rules and instances are original. This sheet does not validate a provider feature or run a model.

Related resources