Skip to content

Commit

Permalink
fix: adjust variable schema to be less of an intrusive change
Browse files Browse the repository at this point in the history
  • Loading branch information
chasepoirier committed Feb 4, 2025
1 parent 3bcdf28 commit 73426d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/validators/src/schemas/v2023_09_28/experience.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,15 @@ const ComponentValueSchema = z
})
.strict();

const EmptyObjectSchema = z.object({ type: z.undefined() });

const ComponentPropertyValueSchema = z.discriminatedUnion('type', [
DesignValueSchema,
BoundValueSchema,
UnboundValueSchema,
HyperlinkValueSchema,
ComponentValueSchema,
EmptyObjectSchema,
]);

export type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;
Expand Down Expand Up @@ -160,7 +163,7 @@ const BaseComponentTreeNodeSchema = z.object({
definitionId: DefinitionPropertyKeySchema,
displayName: z.string().optional(),
slotId: z.string().optional(),
variables: z.record(propertyKeySchema, ComponentPropertyValueSchema.optional()),
variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),
patternProperties: PatternPropertysSchema.optional(),
});
export type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {
Expand Down

0 comments on commit 73426d2

Please sign in to comment.