eclipsesource / eclipsesource/jsonforms

Wrong key for Array item if specific item is selected

Open
#2,096 1 comment 0 reactions 0 assignees View on GitHub
more information required
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

### Describe the bug

When I select a single item from an array through the uischema, I get a wrong key.
I think it is because of the items object. If I do the same with a normal object (without items) instead of an array, then I get the expected result.

schema

```
{
"definitions": {
"order": {
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 5
},
"ordered": {
"type": "boolean"
},
"assignee": {
"type": "string"
},
"choices": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["title"]
}
},
"type": "object",
"properties": {
"orders": {
"type": "array",
"items": {
"$ref": "#/definitions/order",
"format": "html",
"title": "Multi Text Area"
}
}
}
}
```

uischema

```
{
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/orders/items/properties/title"
}
]
}
```

If got the following data:
```
{
"orders": {
"properties": "Test"
}
}
```

### Expected behavior

I expect this output:
```
{
"orders": {
"title": "Test"
}
}
```

### Steps to reproduce the issue

1. clone this repo: [Fankhauser-Dominik/jsonforms-react-seed](https://github.com/Fankhauser-Dominik/jsonforms-react-seed)
2. Play around...

### Screenshots

_No response_

### In which browser are you experiencing the issue?

Not relevant

### Which Version of JSON Forms are you using?

v3.0.0

### Framework

React

### RendererSet

Material

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.