Skip to content

Fix JSON Forms map keys with dots or brackets and schema properties with dots - #3669

Open
wborn wants to merge 2 commits into
enhancement/migrate-json-forms-to-vaadinfrom
json-forms-fix
Open

wborn wants to merge 2 commits into
enhancement/migrate-json-forms-to-vaadinfrom
json-forms-fix

Conversation

@wborn

@wborn wborn commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Description

The Vaadin structured form can interpret characters in literal JSON keys as path syntax. This PR fixes three cases:

  • Map keys with dots. The Modbus Agent Link’s Write value converter now displays both values in {"29.5": 237, "30.0": 241}. Editing 29.5 updates that exact key and leaves 30.0 unchanged.
  • Map keys with brackets. A key such as [0] now displays its value and saves edits under [0]. Editing sensor[0] updates the literal key without creating a sensor array.
  • Schema properties with dots. An existing optional property such as sensor.id now appears in the form and can be edited. Add Parameter creates sensor.name under its full schema property name.

The Agent Link’s read-side Value converter (valueConverter) and Write value converter (writeValueConverter) use the same schema and renderer, so this fix applies to both. The converter regression test exercises the write-side form.

The shared renderer scopes these values so JSON Forms can edit them while preserving the original keys in the serialized object. The backend converter behavior is unchanged.

Targets the Vaadin migration branch from #3371.

Verification

  • Reproduced the display failures before applying the fixes
  • Added Playwright coverage for displaying, editing, and adding the affected keys, with assertions on the exact serialized objects
  • Passed the TypeScript build and all 12 or-json-forms component tests
  • Passed Prettier and git diff --check. ESLint reported seven pre-existing findings

Checklist

  • 1. Acceptance criteria of the linked issue(s) are met
  • 2. Tests are written and all tests pass
  • 3. Changes are manually tested by you and the reviewer
  • 4. Documentation is written or updated

wborn added 2 commits December 4, 2026 16:22
- Treat dotted map keys as literal keys when reading and updating values
- Keep validation errors associated with the corresponding map entry
- Test that the Vaadin write value converter displays both values and edits only the selected entry
- Reuse scoped rendering for bracketed map keys and dotted schema properties
- Use schema property names when adding optional fields
- Verify that edits and additions preserve the exact serialized keys
@wborn wborn changed the title Fix display and editing of dotted map keys in JSON Forms Fix JSON Forms map keys with dots or brackets and schema properties with dots Dec 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

@wborn
wborn requested a review from Ekhorn December 4, 2026 15:41
@wborn wborn added the Bug Error or issue in the system label Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Error or issue in the system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant