Skip to content

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

@BIeBIe

Description

@BIeBIe

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

Which Version of JSON Forms are you using?

3.5.1

Package

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions