jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

Duplicate column definition name provided: "action" in "type": "array"

Open menelai opened this issue 2 months ago • 1 comments

Describe the bug

Error when there is an "action" field in the "type": "array"

Expected behavior

No Error

Steps to reproduce the issue

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Configuration",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "standard",
        "expanded"
      ],
      "default": "standard"
    },
    "entries": {
      "type": "array",
      "title": "Rules",
      "items": {
        "type": "object",
        "required": [
          "action",
          "value"
        ],
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "permit",
              "deny"
            ]
          },
          "value": {
            "type": "string"
          }
        }
      }
    }
  }
}

apply this schema and you'll see: Caught error Error: Duplicate column definition name provided: "action". at getTableDuplicateColumnNameError

Screenshots

No response

Which Version of JSON Forms are you using?

v3.7.0

Package

Angular Material Renderers

Additional context

No response

menelai avatar Dec 01 '25 15:12 menelai

Hi @menelai , thanks for the report ❤️ I can reproduce the behavior. The cause of this is the implementation of in table.renderer.ts pushing a column with name action at the end of the table to contain table actions such as adding a row: https://github.com/eclipsesource/jsonforms/blob/6bbfbb331df36343b0346d41ed80854456fff9ff/packages/angular-material/src/library/other/table.renderer.ts#L214

The column should probably be renamed to contain a jsonforms specific prefix. For instance, for css classes we use prefix jsf-. In that spirit, the column could be renamed to jsf-actions.

lucas-koehler avatar Dec 01 '25 17:12 lucas-koehler