fix: add option for new conditional options behavior - #267
Merged
Conversation
danielcardoso5
marked this pull request as ready for review
July 24, 2026 16:36
Collaborator
Author
sandrina-p
reviewed
Jul 27, 2026
sandrina-p
previously approved these changes
Jul 27, 2026
sandrina-p
left a comment
Collaborator
There was a problem hiding this comment.
Approved! Just a comment on the warning msg, but besides that it looks great. Thanks for updating the MIGRATING.md file too ^.^
eshiota
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to the breaking change introduced in #265.
It adds a new
disallowNewConditionalOptions(defaults tofalse) that allows to opt into the breaking change behavior: disallowing new conditional options from being introduced by conditional logic.This ensures existing usage does not break when #265 is released.
Note
Medium Risk
Changes how conditional schemas affect field options and validation for consumers who opt in or rely on introducing new options via branches; default behavior is preserved but deprecation warnings may surface in production consoles.
Overview
Adds
disallowNewConditionalOptionstocreateHeadlessForm(defaultfalse) so teams can adopt stricter conditional option merging without a breaking release.With the flag
true,mergeSchemaBranchonly keeps branchenum/oneOf/anyOf/ presentationoptionsthat already exist on the base field (narrow or re-label); values the branch adds are dropped. If the base has no option array for that key, branch options can still be applied. With the defaultfalse, branches still replace option arrays wholesale (legacy), but a one-timeconsole.warnpoints callers at the new flag when a branch would add options not on the base.Conditional rule application now passes full
CreateHeadlessFormOptionsintomergeSchemaBranchviamutations.ts. MIGRATING.md documents the migration path; tests cover both modes. Unrelated: removes unusedconvertDiskSizeFromTofromutils.Reviewed by Cursor Bugbot for commit 6db7a33. Bugbot is set up for automated code reviews on this repo. Configure here.