Skip to content

Use explicit oneOf semantics#437

Draft
mpkorstanje wants to merge 4 commits into
mainfrom
envelope-use-one-of
Draft

Use explicit oneOf semantics#437
mpkorstanje wants to merge 4 commits into
mainfrom
envelope-use-one-of

Conversation

@mpkorstanje

@mpkorstanje mpkorstanje commented Jun 8, 2026

Copy link
Copy Markdown
Member

🤔 What's changed?

Introduces the use of OneOf to explicitly mark some fields as mutually exclusive.

This is applied to Envelope, FeatureChild and RuleChild. It could also be applied to PickleStepArgument but with cucumber/gherkin#599 in mind that doesn't seem necessary.

⚡️ What's your motivation?

This will help reduce the envelope size (#395) and clarify the semantics for some mutually exclusive fields.

🏷️ What kind of change is this?

  • 💥 Breaking change (incompatible changes to the API)

♻️ Anything particular you want feedback on?

I could use some help implementing this change for other languages. Java doesn't support tagged unions. Other languages might.

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

@mpkorstanje

Copy link
Copy Markdown
Member Author

I'm going to park this until we're done with cucumber/gherkin#599, and #431.

@davidjgoss

Copy link
Copy Markdown
Member

I can add the JavaScript code generation for this.

FYSA I'm also landing #438 first as this will be much easier once we're just dealing with types as opposed to classes.

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.

2 participants