Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
acomagu opened this issue Sep 19, 2023 · 2 comments · Fixed by #2189
Closed

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

acomagu opened this issue Sep 19, 2023 · 2 comments · Fixed by #2189
Assignees
Milestone

Comments

@acomagu
Copy link

acomagu commented Sep 19, 2023

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

@lucas-koehler
Copy link
Contributor

Thanks for the report :)

@lucas-koehler lucas-koehler added this to the next milestone Sep 22, 2023
@sdirix sdirix modified the milestones: next, 3.2 Sep 26, 2023
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Oct 10, 2023
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Oct 10, 2023
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Oct 10, 2023
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Oct 22, 2023
LukasBoll added a commit to LukasBoll/jsonforms that referenced this issue Oct 24, 2023
Previously, enums without type-attribute weren't recognized by the
derive types function, leading to omitted enums in generated uischemas.

Closes eclipsesource#2177
lucas-koehler pushed a commit that referenced this issue Oct 25, 2023
Previously, enums without type-attribute weren't recognized by the
derive types function, leading to omitted enums in generated uischemas.

Closes #2177
@acomagu
Copy link
Author

acomagu commented Oct 25, 2023

Thank you for your works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants