Skip to content

Fix additionalProperties in XLR types#240

Open
justin-medeiros wants to merge 4 commits intoplayer-ui:mainfrom
justin-medeiros:ts-xlr-fix
Open

Fix additionalProperties in XLR types#240
justin-medeiros wants to merge 4 commits intoplayer-ui:mainfrom
justin-medeiros:ts-xlr-fix

Conversation

@justin-medeiros
Copy link

@justin-medeiros justin-medeiros commented Feb 20, 2026

This PR fixes a an issues with additionalProperties XLR types.

AdditionalProperties merge (xlr/converters/src/ts-to-xlr.tshandleHeritageClauses)

NavigationFlowEndState should allow any field, but in XLR additionalProperties was false because handleHeritageClauses only took additionalProperties from the extended type(s). NavigationBaseState does not allow arbitrary fields; when it was the (only) source, the merged type had additionalProperties: false even though NavigationFlowEndState should allow extra keys.

What was happening: The validator threw an error on valid navigation state JSON, e.g.:

"END_TEST": {
  "state_type": "END",
  "outcome": "TEST_OUTCOME",
  "param": "test-param"
}

Fix: We now merge the current interface’s additionalProperties with those from all extended types (already collected). When there are multiple, we combine them with an or type so the merged XLR allows any of those index signatures.

XLR before:

{
    "source": "src/index.ts",
    "name": "NavigationFlowEndState",
    "type": "object",
    "properties": {...},
    "additionalProperties": false,
   ...
}

XLR after:

{
    "source": "src/index.ts",
    "name": "NavigationFlowEndState",
    "type": "object",
    "properties": {...},
    "additionalProperties": {
        "type": "unknown"
    },
   ...
}

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major

@justin-medeiros justin-medeiros requested a review from a team as a code owner February 20, 2026 20:34
@justin-medeiros justin-medeiros marked this pull request as draft February 20, 2026 21:24
@justin-medeiros justin-medeiros changed the title Fix validator throwing incorrect errors Fix additionalProperties in XLR types Feb 20, 2026
@justin-medeiros justin-medeiros marked this pull request as ready for review February 23, 2026 23:43
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