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

using oneOf object or boolean doesn't render the boolean #221

Closed
shanejonas opened this issue May 9, 2023 · 0 comments · Fixed by #222
Closed

using oneOf object or boolean doesn't render the boolean #221

shanejonas opened this issue May 9, 2023 · 0 comments · Fixed by #222

Comments

@shanejonas
Copy link

shanejonas commented May 9, 2023

Trying to use this component for the MetaMask docs with OpenRPC and running into this bug with oneOf object or string.

Heres an example schema and a gif of the results in storybook.

Seems like it only works if the sub schemas of the oneOf are the same type.

{
  "title": "Syncing status",
  "oneOf": [
    {
      "title": "Syncing progress",
      "type": "object",
      "properties": {
        "startingBlock": {
          "title": "Starting block",
          "type": "string"
        },
        "currentBlock": {
          "title": "Current block",
          "type": "string"
        },
        "highestBlock": {
          "title": "Highest block",
          "type": "string"
        }
      }
    },
    {
      "title": "Not syncing",
      "description": "Should always return false if not syncing.",
      "type": "boolean"
    }
  ]
}

Screen grab:

oneOf_issie

Expected Behaviour

When Not Syncing is clicked, it should show you type boolean

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

Successfully merging a pull request may close this issue.

1 participant