question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use uiSchema to customize oneOf/anyOf with different types

See original GitHub issue

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

I would like to use oneOf with different types. (another way of solving the problem in issue #282)

Steps to Reproduce

Use this schema:

{
  "type": "object",
  "properties": {
    "name": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        }
      ]
    }
  }
}

Playground link

Expected behavior

Want to be able to select different types.

Actual behavior

I get this: image

Version

1.2.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
loganvolkerscommented, Jan 22, 2019

Normally you’d be able to use UISchema to change the widget used (for example to change it to a range or number input), however this doesn’t currently work with anyOf/oneOf.

That sounds like something worth fixing

0reactions
stale[bot]commented, Apr 15, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

uiSchema - react-jsonschema-form documentation
To change the input type (for example, tel or email ) you can specify the inputType in the ui:options uiSchema directive. const schema...
Read more >
oneOf, anyOf, allOf, not
OAS 3 This guide is for OpenAPI 3.0. oneOf, anyOf, allOf, not. OpenAPI 3.0 provides several keywords which you can use to combine...
Read more >
npm:@ingo-inc/react-jsonschema-form
A simple React component capable of building HTML forms out of a JSON schema. Usage no npm install needed! Copy. Open in CodePen....
Read more >
Controls - JSON Forms
JSON Forms will render the following form from this UI Schema: ... By default, controls use the name of property they point to...
Read more >
Implementations | JSON Schema
Supports: 2020-12, 2019-09 draft-07, -04; License: Apache License, Version 2.0; Notes: Validator for Eclipse Vert.x project JSON types. Includes custom ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found