Required fields validated inside an optional object

Builder public api key

1162ece101bb43d0ba429df56e2009cd

Builder content link

Detailed steps to reproduce the bug

  1. Add an object field to a data model and mark it not required
  2. Add child fields inside the object, each marked required
  3. Create a content entry and leave the object empty
  4. Click Publish — every required child field reports a validation error, even though the parent object is optional and untouched

This is a regression; the same model published fine until recently.

Expected vs actual

  • Expected: an empty optional object passes validation regardless of its children’s required flags
  • Actual: required validation on the children fires unconditionally, blocking publish

Code stack

Next.js 16.2.4, React 19.2.5, Vercel

Workaround

Removed required from the child fields so editors can publish. Downside: editors can now publish incomplete entries, and the frontend has to defensively handle fields that were previously guaranteed.

Hi @josh, thanks for the detailed report!

This is actually expected behavior, not a regression. When you mark child fields as required inside an object, those fields must be filled in before publishing — regardless of whether the parent object itself is optional.

Here’s the reasoning: the required flag on a child field means “this field must have a value if it exists in the model.” Since the fields are defined in your data model, Builder’s validation will enforce them at publish time.

What this means in practice:

  • If you want the entire object (including its children) to be truly optional, you should either remove the required flag from the child fields, or use conditional logic to only validate children when the parent object is explicitly filled.
  • If you do want to use the object, all required child fields must be populated before you can publish.

The workaround you found (removing required from child fields) is one valid approach. Alternatively, if you decide to use the object in a content entry, simply fill in all the required child fields and publishing will succeed.

Hope that clears things up! Let us know if you have further questions.