jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

using '/' in initialisation json results in 'No applicable renderer found.'

Open neuralsea-lab opened this issue 4 years ago • 2 comments

Describe the bug using '/' in initialisation json results in 'No applicable renderer found.'

To Reproduce

  1. Use JsonForms data json
{
    "some / initial / value": 0.0,
}
  1. load form
  2. Cell does not display with error 'No applicable renderer found.'

Expected behavior Cell to display

Screenshots

Browser (please complete the following information):

  • Browser - chrome latest

Used Setup (please complete the following information):

  • Framework: react
  • RendererSet: material

Additional context None

neuralsea-lab avatar Feb 17 '21 11:02 neuralsea-lab

Hi @neuralsea-lab, thanks for the report!

JSON Forms doesn't handle special characters like / and ~ properly. The ui schema generator needs to improved to detect these characters and encode them to ~1 and ~0 in the scopes respectively. Also our resolving code needs to be adapted to respect these encodings and transform them back. We also need to keep backward compatibility in mind as currently you can just use ~ in JSON Forms without problems.

For now I would like to suggest to transform your data and schema before handing it to JSON Forms (for example by replacing all / in property names with ~) and transforming the outgoing data back to using /. This should be rather straightforward.

sdirix avatar Feb 19 '21 09:02 sdirix

ToDo:

  • Adapt the ui schema generator, to properly encode the special characters in the scope. The ui schema generator code is here.
  • Adapt the resolving code to properly respect encoded values by transforming them back when needed. Maybe it's enough to decode them after this split, but this needs to be checked.
  • Add testcases for the ui schema generator and the resolver

sdirix avatar Jul 06 '21 14:07 sdirix

Fixed in JSON Forms 3.0 with https://github.com/eclipsesource/jsonforms/pull/1834

sdirix avatar Nov 08 '22 21:11 sdirix