# Structured output checklist

_Valid JSON can still be missing the key your insert needs_  
@demotoprod · EVALS · also LEVERS · October 2026

JSON mode guarantees valid JSON and says nothing about your keys, so a required field can go missing and the output still parses. Five checks, each sized for an afternoon, put a strict schema, a stop-reason test, a validator and a retry-then-park path before your database.

**One gate per endpoint, before the database**

```
decoding: strict_json_schema       # not JSON mode
schema:
  every_key_required: true         # at every nesting level
  additional_properties: false     # on every object
  optional_field: union_with_null
before_parse: {refusal: send_to_person, token_limit: retry_once}
validate_in_code: [required_keys, ranges, lengths, enum_values]
on_failure:
  retries_with_error: 1            # one framework's default
  then: review_queue               # never the database
```

- [ ] **1. Switch from JSON mode to strict schema decoding**

  **What happened.** One provider's guide says both modes ensure valid JSON, but only structured outputs ensure schema adherence. In its 2024 evals of complex schema following, one model with strict decoding scored 100%, an earlier model under 40%: what can happen, not every model.

  **The check.**
  - Move each call from JSON mode to a strict JSON-schema response format, one endpoint at a time.
  - Replay saved production prompts through both paths and count missing keys.

  Source: [Structured model outputs, a model API provider's guide, read 27 Oct 2026](https://developers.openai.com/api/docs/guides/structured-outputs)

  Source: [Introducing structured outputs in the API, 6 Aug 2024](https://openai.com/index/introducing-structured-outputs-in-the-api/)

- [ ] **2. List every key as required and close every object**

  **What happened.** In JSON Schema, properties are not required by default and extra properties are allowed, so an object missing your key is valid. One platform's guide asks for every field as required, additionalProperties false, and a null union for optional fields.

  **The check.**
  - List every key in required at every nesting level; set additionalProperties to false on every object.
  - Write an optional field as a type union with null, so the key is always present.

  ```
  {"type": "object", "required": ["id", "unit"],
   "properties": {"id": {"type": "string"}, "unit": {"type": ["string", "null"]}},
   "additionalProperties": false}
  ```

  Source: [JSON Schema reference, object: required and additional properties, read 27 Oct 2026](https://json-schema.org/understanding-json-schema/reference/object)

  Source: [Structured outputs, cloud platform documentation, updated 24 Aug 2026](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/structured-outputs)

- [ ] **3. Read the stop reason before you parse**

  **What happened.** One provider's guide lists cases where output might not match the schema: a refusal, whose message takes precedence over the schema, and a response cut off at the token limit, which might be incomplete. One client library raises an error on length and content-filter stops.

  **The check.**
  - Read the refusal field and the stop reason first; parse only when the run ended normally.
  - Send a refusal to a person; on a token-limit stop, retry once with a higher limit.

  Source: [Structured outputs, a model API provider's documentation, read 27 Oct 2026](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

  Source: [Helpers for structured outputs, a client library's documentation, read 27 Oct 2026](https://github.com/openai/openai-python/blob/main/helpers.md)

- [ ] **4. Validate every object in your own code, and reject on failure**

  **What happened.** The same guide lists minimum, maximum and string-length constraints as unsupported in schemas and does not guarantee enum capitalization; its validating helper still enforces every constraint in your code. A validation library raises an error on invalid data.

  **The check.**
  - Check every response against all constraints: required keys, ranges, lengths, enum values.
  - On failure, discard the whole object; do not fill defaults, trim values or fix keys by hand.

  ```
  data = json.loads(text)
  missing = REQUIRED - data.keys()
  if missing or not 0 < data["qty"] <= 1000:
      return retry_or_park(text, sorted(missing))
  ```

  Source: [Structured outputs, a model API provider's documentation, read 27 Oct 2026](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)

  Source: [Models, a validation library's documentation, read 27 Oct 2026](https://pydantic.dev/docs/validation/latest/concepts/models/)

- [ ] **5. Retry once with the error, then park the object**

  **What happened.** One agent framework validates output, tells the model to try again on failure, and defaults its output retry budget to 1. A receiver that cannot process a message should move it to an invalid message channel.

  **The check.**
  - Retry once, adding the validation error and the failed object to the prompt; log each retry.
  - After a second failure, send the object to a review queue, not the database; alert on growth.

  Source: [Output, an agent framework's documentation, read 27 Oct 2026](https://pydantic.dev/docs/ai/core-concepts/output/)

  Source: [Invalid Message Channel, enterprise integration pattern, read 27 Oct 2026](https://www.enterpriseintegrationpatterns.com/patterns/messaging/InvalidMessageChannel.html)

The 100% and under 40% are one lab's 2024 evals of one model: what can happen, not every model. Limits are as documented on 27 Oct 2026. The retry count of 1 is one framework's default; effort is a planning estimate; code values are examples.

The live version of this list, with every source link, is at https://indica-tech.com/checklists/structured-outputs/. The PDF is at https://indica-tech.com/checklists/lead-magnets/LEVERS-structured-outputs-checklist-2026-10.pdf.

---

**Nitish Gautam — Indica Technology Ltd.** Founder-led AI engineering: demo to production, in regulated industries, on fixed scope.

Website https://indica-tech.com · Book a call https://indica-tech.com/#contact · hello@indica-tech.com

YouTube youtube.com/@demotoprod · LinkedIn linkedin.com/company/indica-technology · Instagram and TikTok @demotoprod

_Structured output checklist · October 2026 · @demotoprod_
