feat: collect nested user-schema fields by dotted path - #756
Draft
vitorbari wants to merge 3 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
🦋 Changeset detectedLatest commit: 489100e The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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 |
vitorbari
force-pushed
the
feat/nested-user-schema-fields
branch
from
August 5, 2026 08:16
3c18192 to
e763bb7
Compare
A flow step could only reference a top-level scalar property. Naming an object-typed property resolved silently as a text input and only failed at create_user, with an error the user could not act on; naming a nested leaf (`address.street`) failed as an unknown property. A schema whose top-level `required` held an object was unauthorable: the only name that satisfied the coverage check was the one that misrendered. The attribute store already keyed nested values by their dotted path and already honored `x-unique` on a nested leaf, so this closes the flow-engine half of a contract the rest of the system had implemented. - Resolve a field by walking its dotted path, one `properties` level per segment, reusing AttributeKey.Nodes so a field path and an attribute key are the same string by construction. - Derive Required by ANDing `required` membership across the ancestor chain, the only rule under which satisfying the form satisfies schema validation. - Reject an object- or array-typed property as a field with the new ErrFlowFieldNotScalar, including one carrying `properties` but no `type`. - Check required coverage against nested `required`, so a required object demands one of its leaves. - Merge collected values into a nested document and read them back through maputil.GetNested, keeping UserData in the shape the schema validates. - Reject a schema property name holding a dot, now ambiguous with a path. The TypeScript plan-time validator mirrors all of it so `plan` and `apply` still speak the same words, and the normalizer recurses into nested properties to avoid a phantom GitOps diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Example 07 collects an object-typed schema property one leaf at a time (`address.street`), so the dotted-path spelling has a worked reference next to the flows that use flat fields. The example schema in examples_test.go gains a matching `address` object, keeping `address` optional at the root so the required-coverage check on examples 01-06 is unaffected. The round-trip test now covers 07, which means the example is validated end-to-end rather than only documented. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`segments[i]` is `string | undefined` under noUncheckedIndexedAccess, so indexing with it failed `tsc --build`. Iterating with `segments.entries()` yields a plain string and drops the optional chain's dead branch. Because validate.ts then failed to emit its declarations, every test file importing it fell back to `unknown`, producing a cascade of TS6305/TS7006 errors across the package that all clear with this fix. The one genuine test-side error went with it: deleting `.required` through an index expression is unsound for the same reason, so that case now states its schema shape directly instead of deriving it by mutation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
vitorbari
force-pushed
the
feat/nested-user-schema-fields
branch
from
August 7, 2026 11:04
8d4a63f to
489100e
Compare
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.
Summary
Flow steps can collect nested user-schema properties by dotted path:
{ "name": "address", "fields": ["address.street", "address.city"], "on_success": "create_user" }Schema property names may no longer contain a dot, which would be ambiguous with a nested path.
packages/configmirrors the validator sozitadel planmatchesapply. No client changes.Notes
Tests
DB: