eclipsesource / eclipsesource/jsonforms

Arrays are displayed in list form, and enumeration values cannot define 'integer'?

Open
#2,418 1 comment 0 reactions 1 assignee Claimed by @sdirix View on GitHub
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

### Describe the bug

When displaying data in array format with a single line, if the field is "integer" and the data source uses oneOf to define enumeration, the dropdown box cannot be displayed on the list. Instead, the numeric adjuster is displayed, and it cannot be displayed in the form of a dropdown box.

But testing found that defining it as a "string" type can be effective

### Expected behavior

Display in dropdown format

### Steps to reproduce the issue

1、json

` uploadDataAccess: [
{
value: true,
level: 1,
......
},
]`

2、schema

` "uploadDataAccess": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "boolean"
},
"level": {
"type": "integer",
"$ref": "#/$defs/levelOptions"
}
},
"required": ["name", "value", "level"]
}
}`

` "$defs": {
"levelOptions": {
"type": "integer",
"oneOf": [
{
"const": 1,
"title": "one"
},
{
"const": 2,
"title": "two"
}
]
}
}`

3、uischema

` {
"type": "Group",
"elements": [
{
"type": "Control",
"scope": "#/properties/uploadDataAccess",
"options": {
"format": "array"
}
}
]
}`

### Screenshots

![Image](https://github.com/user-attachments/assets/14db5b8b-19d7-415b-8a1a-4c3b1fedaec1)

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

3.5.1

### Package

_No response_

### 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.