Skip to content

Prefer primitive names in union errors#236

Merged
KetanReddy merged 3 commits intoplayer-ui:mainfrom
shahabdsh:fix/primitive-type-expected-types
Feb 9, 2026
Merged

Prefer primitive names in union errors#236
KetanReddy merged 3 commits intoplayer-ui:mainfrom
shahabdsh:fix/primitive-type-expected-types

Conversation

@shahabdsh
Copy link
Contributor

@shahabdsh shahabdsh commented Feb 6, 2026

Summary

  • Prefer primitive node.type values when formatting expected types for union validation errors
  • Add a regression test

This change will result in clearer errors for primitive value validations:
Before: Asset Validation Error - value: Does not match any of the types: MyAsset.value | ExpressionRef | BindingRef
After: Asset Validation Error - value: Does not match any of the types: number | ExpressionRef | BindingRef

Change Type (required)

Indicate the type of change your pull request is:

  • patch
  • minor
  • major

@shahabdsh shahabdsh requested a review from a team as a code owner February 6, 2026 22:19
@shahabdsh shahabdsh marked this pull request as draft February 6, 2026 22:21
@shahabdsh shahabdsh force-pushed the fix/primitive-type-expected-types branch from 08f1d97 to 2c02019 Compare February 6, 2026 22:22
@shahabdsh shahabdsh marked this pull request as ready for review February 9, 2026 18:16
sdk.loadDefinitionsFromModule(ReferenceAssetsWebPluginManifest);

const validator = new XLRValidator(sdk.getType);
const validator = new XLRValidator(sdk.getType.bind(sdk));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this breaking something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checked again and it wasn't necessary - removed it!

shahabdsh and others added 3 commits February 9, 2026 13:28
Use primitive node.type values when formatting expected types for
union validation errors and add a regression test.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@shahabdsh shahabdsh force-pushed the fix/primitive-type-expected-types branch from 0cc3325 to 11db9b9 Compare February 9, 2026 18:28
@KetanReddy KetanReddy added the patch Increment the patch version when merged label Feb 9, 2026
@KetanReddy KetanReddy merged commit 1646e8d into player-ui:main Feb 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Increment the patch version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants