Skip to content

fix: make schema consumers tolerant of nullable containers - #2221

Draft
kpal81xd wants to merge 10 commits into
mainfrom
fix/schema-consumer-nullability
Draft

fix: make schema consumers tolerant of nullable containers#2221
kpal81xd wants to merge 10 commits into
mainfrom
fix/schema-consumer-nullability

Conversation

@kpal81xd

Copy link
Copy Markdown
Contributor

Makes the editor's schema API tolerant of catalogs where object containers and reference fields are nullable (anyOf: [{…}, {type: 'null'}]) and carry explicit defaults, instead of being implicitly absent. All changes are backward-compatible with today's catalog.

  • getFields / getAssetTypes resolve through a nullability wrapper.
  • Metadata accessors read the wrapper, then the inner branch.
  • Settings/scene materializers merge a container's default with its children.
  • Template diff treats an explicit null as equal to an absent key.
  • Presence-encoded flags (Custom AABB, UV1, imported material, font mode, priority scripts) read their value rather than key presence.
  • MCP unset deletes on dynamic paths and resets fixed fields to their default.
  • Drains the legacy static lightmap duplicate.

Smoke test

  1. Open a project — editor boots and the scene loads.
  2. Add a model component — the inspector renders.
  3. Toggle Custom AABB — the model is not culled.
  4. Open a font asset — the PROPERTIES panel is visible.
  5. Create a template instance — no spurious override badge.

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
editor Ready Ready Preview Aug 26, 2026 9:10am

Request Review

@kpal81xd kpal81xd self-assigned this Aug 26, 2026
Extract the comparison into a pure, testable module (matching the toolbar-order pattern); deep-equal.ts keeps the editor.method wiring. The missingFlagForField null-guard decision (Step 5) is deferred to the integrated template-instance e2e, since a spurious override can only manifest once the explicit-null catalog is deployed.
…resence

Custom-AABB toggle now reads aabbCenter as a value and writes the explicit null off-state on both the change and undo handlers, so turning it off never deletes the required key. UV1 and imported-material checks read their explicit values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant