Repository navigation
Conversation
✅ Deploy Preview for openworkflow-editor ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: ba79910 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
🟡 Changes recommended
Variant generation can hide valid fields and remove values during switching, while Apply can reset the selected variant when multiple partial matches are compatible.
2 open issues
What changed in this PR
This PR updates the diagram editor’s schema-driven forms to show required AsyncAPI fields and offer selectors for required-field combinations.
Changes:
- Derives shared required keys and builds variants for multi-key combinations.
- Updates active-form validation to track multiple identifying keys per variant.
- Adds combination coverage, expands AsyncAPI fixtures, and records a patch changeset.
| File | Description |
|---|---|
packages/open-workflow-diagram-editor/tests/side-panel/forms/validation/activeFormView.test.ts |
Tests multiple identifying keys and presence-key fallback. |
packages/open-workflow-diagram-editor/tests/fixtures/taskValidation.ts |
Adds AsyncAPI combinations and updates expected validation paths. |
packages/open-workflow-diagram-editor/tests/core/schemaToFormFields.test.ts |
Tests combination variants, matching, and shared required fields. |
packages/open-workflow-diagram-editor/src/side-panel/forms/validation/activeFormView.ts |
Tracks each variant’s identifying keys for validation. |
packages/open-workflow-diagram-editor/src/core/schemaToFormFields.ts |
Adds shared-required-key inference and combination variant generation. |
.changeset/fix-asyncapi-combinations.md |
Records the diagram editor patch release. |
Review effort: Balanced
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
Signed-off-by: Handrey Cunha <handrey.cunha@gmail.com>
9e1f11d to
ba79910
Compare
|
Rebased! Ready for review. |

Closes #538
This PR fixes required oneOf combinations and its combination scenarios.
The form builder drops multi-key required combinations when a property has a oneOf whose entries only contain required (no properties, type or $ref), it treats it as "validation-only".
It then handles only one shape:
The AsyncAPI entries have 3 keys each, so they hit the second case.
The fix is to break down the oneOf combinations into three groups:
Changes
schemaToFormFields.tsrequiredKeys(schema): intersects therequiredlists across all required-only candidates — keys present in every combination are effectively always required. Merged into the child required set so the plain-object branch picks them up. The single-key MCP case is unaffected.isRequiredOnlyCandidateandrequiredListhelpers (extracted from existing inline predicates).buildCombinationVariants: when candidates have more than one key each, builds oneOneOfVariantper combination. Keys shared across all combinations are required in every variant; identifying keys are required only in their own variant and hidden in the others. Variant label is the join of its identifying keys' display names (e.g."Operation + Message").buildOneOfFieldhelper used at all threeone-ofconstruction sites.capitalizehelper, extracted from an existing inline expression.requiredSetdefault now callsrequiredKeysinstead of readingschema.requireddirectly — fix applies uniformly to ordered-map items, event-filter items and plain-object children.OneOfVariant.requiredKey→identifyingKeys: string[]to support multi-key identifying sets.activeFormView.tsbuildActiveFormViewnow iteratesvariant.identifyingKeys(falling back to[variant.presenceKey]) when tracking active vs other variant keys, so presence tracking works for combination variants.How to test
Open Storybook → Examples → Call AsyncAPI Publish in edit mode.
1. Required marker and no remove ✕
documentmust show a required marker and have no remove ✕.2. Variant switcher — Operation + Message ↔ Channel + Subscription
messagekeeps its value,operationdisappears and an emptychannelfield appears.operationis gone from the YAML.3. Optional fields stay optional
server,protocolandauthenticationare in no combination — they must remain optional with a remove ✕.