Skip to content

Bug: initialTransitionObject schema requires eventType but does not define it in properties #5368

@nirajkashyap1

Description

@nirajkashyap1

XState version

XState version 5

Description

In the machine schema (packages/core/src/machine.schema.json), the definition for $defs.initialTransitionObject includes "eventType" as a required property (see "required": ["actions", "eventType", "source", "target"]), but "eventType" is not listed in the "properties" object. This means schemas that validate against this definition will fail, or the schema is invalid. This is likely an oversight and "eventType" should be added to the properties definition, or removed from the required list if not needed.

Expected result

The schema definition for initialTransitionObject should either include an eventType property (type: string) in properties, or remove eventType from the required array if it is not needed.

Actual result

eventType is currently required but not present in the properties for initialTransitionObject, leading to schema validation errors or confusion.

Reproduction

Open packages/core/src/machine.schema.json and inspect the $defs.initialTransitionObject section. Observe that eventType is in required but not in properties.

Additional context

This bug was identified by inspecting the schema file directly. No specific XState version context, but it is present in the current main branch.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions