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

Broken behaviour for oneOf inside array #1168

Closed
3 tasks done
LucianBuzzo opened this issue Feb 6, 2019 · 2 comments
Closed
3 tasks done

Broken behaviour for oneOf inside array #1168

LucianBuzzo opened this issue Feb 6, 2019 · 2 comments
Assignees
Labels

Comments

@LucianBuzzo
Copy link
Collaborator

LucianBuzzo commented Feb 6, 2019

Prerequisites

Description

Using oneOf inside an array, where one branch is an integer and the other branch is an object is broken. When selecting the second option, the correct fields are not rendered at all.

{
  "type": "object",
  "properties": {
    "myArray": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "integer"
          },
          {
            "type": "object",
            "properties": {
              "elt1": {
                "type": "integer"
              },
              "elt2": {
                "type": "string"
              }
            },
            "required": [
              "elt1",
              "elt2"
            ]
          }
        ]
      }
    }
  }
}

playground link

Originally reported by @Rasstrelnikov here #1141 (comment)

@LucianBuzzo LucianBuzzo added the bug label Feb 6, 2019
@LucianBuzzo LucianBuzzo self-assigned this Feb 6, 2019
LucianBuzzo added a commit that referenced this issue Feb 6, 2019
Fixes #1168

- Fixed a bug that would prevent input fields from rendering when
switching between a non-object type option and an object type option
- Fixed a bug where options would incorrectly change when entering
values if a subschema with multiple required fields is used
- Fixed a bug where switching from an object tpye option to a non-object
type option would result in an input field containing the value [Object object]

Change-type: patch
Signed-off-by: Lucian <lucian.buzzo@gmail.com>
@PhilipK2
Copy link

PhilipK2 commented Feb 6, 2019

How do I signup to be notified when this functionality is complete?

@LucianBuzzo
Copy link
Collaborator Author

@PhilipK2 You can "watch" the repo to be notified of activity on it.

LucianBuzzo added a commit that referenced this issue Feb 12, 2019
Fixes #1168

- Fixed a bug that would prevent input fields from rendering when
switching between a non-object type option and an object type option
- Fixed a bug where options would incorrectly change when entering
values if a subschema with multiple required fields is used
- Fixed a bug where switching from an object tpye option to a non-object
type option would result in an input field containing the value [Object object]

Change-type: patch
Signed-off-by: Lucian <lucian.buzzo@gmail.com>
epicfaace pushed a commit that referenced this issue Feb 21, 2019
…1169)

* Fix multiple bugs related to switching between anyOf/oneOf options

Fixes #1168

- Fixed a bug that would prevent input fields from rendering when
switching between a non-object type option and an object type option
- Fixed a bug where options would incorrectly change when entering
values if a subschema with multiple required fields is used
- Fixed a bug where switching from an object tpye option to a non-object
type option would result in an input field containing the value [Object object]

Change-type: patch
Signed-off-by: Lucian <lucian.buzzo@gmail.com>

* Update src/utils.js

* Update src/utils.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants