jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

special character in property name (dot)

Open Deepak1100 opened this issue 5 years ago • 3 comments

Describe the bug I have '.' in one property name it's creating key in form like object.key example:

"parameters": {
          "type": "object",
          "properties": {
            "rds.logical_replication": {
              "type": "string",
              "enum": [
                "1",
                "0"
              ],
              "default": "1"
            }
          }
},
        {
          "type": "FoldableGroup",
          "id": "parameters",
          "parentId": "database",
          "label": "DB Parameter",
          "scope": "#/properties/extraResources/properties/database/properties/parameters",
          "elements": [
            {
              "type": "Control",
              "label": "rds.logical_replication",
              "scope": "#/properties/extraResources/properties/database/properties/parameters/properties/rds.logical_replication"
            }
          ]
        },

The output looks like this

      "parameters": {
        "rds": {
          "logical_replication": "0"
        },
        "rds.logical_replication": "1"
      },

Expected behavior

      "parameters": {
        "rds.logical_replication": "1"
      },

i think the problem is with the scope

#/properties/extraResources/properties/database/properties/parameters/properties/rds.logical_replication

is there way i can escap special characther?

Used Setup (please complete the following information): react

Deepak1100 avatar Aug 27 '20 06:08 Deepak1100

Hi @Deepak1100, we're using lodash's get internally so you could try escaping the property with quotation marks.

Either way we should get this fixed in JSON Forms at some point! Thanks for the report!

sdirix avatar Sep 16 '20 16:09 sdirix

Hello. We are using jsonforms with the Material UI renderers. Would this issue be related to why when using the boolean control, special characters are getting stripped from property names? The label of the control seems to be sanitized.

Property in schema: Band & Orchestra: {type: Boolean}

This is rendered via MaterialBooleanControl/MUI Checkbox Screen Shot 2021-11-23 at 4 44 42 PM

Update: It turns out the we just did not have label properties included in the schema for these items. Once adding, the special characters rendered fine.

emergencyofstate avatar Nov 24 '21 00:11 emergencyofstate

Hello. We are using jsonforms with the Material UI renderers. Would this issue be related to why when using the boolean control, special characters are getting stripped from property names? The label of the control seems to be sanitized.

Property in schema: Band & Orchestra: {type: Boolean}

This is rendered via MaterialBooleanControl/MUI Checkbox Screen Shot 2021-11-23 at 4 44 42 PM

Update: It turns out the we just did not have label properties included in the schema for these items. Once adding, the special characters rendered fine.

Hi @emergencyofstate, we use lodash's startCase on the property name when there are no JSON Schema title or UI Schema label defined. Among other things it removes special characters.

sdirix avatar Dec 13 '21 07:12 sdirix

Hello, may I know that is there any plan for this issue? thanks.

cmeng-talend avatar Jan 03 '23 08:01 cmeng-talend

We settled on an improvement, documented it in #2153 and will start developing it soon. Therefore I'll close this issue as the follow up already exists.

sdirix avatar Jun 29 '23 11:06 sdirix