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

Support oneOf syntax in BooleanField with radio widget. #945

Closed
2 tasks done
JamesGuthrie opened this issue Jun 6, 2018 · 0 comments
Closed
2 tasks done

Support oneOf syntax in BooleanField with radio widget. #945

JamesGuthrie opened this issue Jun 6, 2018 · 0 comments

Comments

@JamesGuthrie
Copy link

Prerequisites

  • I have read the documentation;
  • In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.

Description

Recently support for the oneOf syntax was added for enums, it can be used to replace the existing enum/enumNames syntax which does not conform to the json schema spec.

Steps to Reproduce

json schema

{
  "title": "An example of bad behaviour",
  "type": "object",
  "properties": {
    "test": {
      "type": "boolean",
      "oneOf": [
        {
          "const": true,
          "title": "True"
        },
        {
          "const": false,
          "title": "False"
        }
      ]
    }
  }
}

UI schema:

{
  "test": {
    "ui:widget": "radio"
  }
}

I've set up a sample JSFiddle demonstrating the issue.

Expected behavior

The title values in the oneOf objects are used for titles of the radios

Actual behavior

The titles of the radios are yes/no

Version

v1.0.3

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

No branches or pull requests

1 participant