Skip to content

Enum without "type" can't be rendered #2177

@acomagu

Description

@acomagu

Describe the bug

Enum definition without "type", like:

{
  "enum": ["A", "B"]
}

, is valid JSON Schema, but can't be rendered.

Expected behavior

Rendered as normal enum.

Steps to reproduce the issue

The following schema does not render any fields:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "foo": {
      "enum": ["A"]
    }
  }
}

image

And the following schema causes runtime error, options is undefined at this line:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "foo": {
      "type": "string",
      "anyOf": [
        {
          "enum": ["A", "B"]
        },
        {
          "enum": ["C", "D"]
        }
      ]
    }
  }
}

image

Screenshots

No response

In which browser are you experiencing the issue?

Firefox 117.0 (64-bit Windows)

Which Version of JSON Forms are you using?

v3.1.0

Framework

React

RendererSet

Material

Additional context

I don't give any UI Schema(using default behavior).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions