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

Default value does not work within anyOf PG #1340

Closed
3 tasks done
goralight opened this issue Jun 29, 2019 · 1 comment
Closed
3 tasks done

Default value does not work within anyOf PG #1340

goralight opened this issue Jun 29, 2019 · 1 comment

Comments

@goralight
Copy link

Prerequisites

Description

When using anyOf, the default value does not get set correctly. This can be seen on the example PG for anyOf

Steps to Reproduce

  1. Go to PG link
  2. Select anyOf button
  3. Notice how the default value is set for Chuck and Norris. Yet on the form data and on the preview, it has not populated the values

Expected behavior

Defaults within anyOf populate the data and preview

Actual behavior

Defaults within anyOf do not populate data or preview

Version

I am using the online PG for now. Example of Json Is below:

  "type": "object",
  "properties": {
    "age": {
      "type": "integer",
      "title": "Age"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "anyOf": [
          {
            "properties": {
              "foo": {
                "type": "string"
              }
            }
          },
          {
            "properties": {
              "bar": {
                "type": "string"
              }
            }
          }
        ]
      }
    }
  },
  "anyOf": [
    {
      "title": "First method of identification",
      "properties": {
        "firstName": {
          "type": "string",
          "title": "First name",
          "default": "Chuck"
        },
        "lastName": {
          "type": "string",
          "title": "Last name"
        }
      }
    },
    {
      "title": "Second method of identification",
      "properties": {
        "idCode": {
          "type": "string",
          "title": "ID code"
        }
      }
    }
  ]
}

I know this has apparently been done:
#1304

But within the PG it is still not working correctly.

@epicfaace
Copy link
Member

Duplicate of #1334

@epicfaace epicfaace marked this as a duplicate of #1334 Jun 29, 2019
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

2 participants