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

JSON Schema default value support #570

Closed
chakraborty-slx opened this issue May 17, 2017 · 5 comments
Closed

JSON Schema default value support #570

chakraborty-slx opened this issue May 17, 2017 · 5 comments
Milestone

Comments

@chakraborty-slx
Copy link

chakraborty-slx commented May 17, 2017

Does data Schema default value, is used during render?

Schema extract:

"isVisible": {
  "type": "boolean",
  "default":true
}

UI schema:

{
  "type": "Control",
  "label": "Is Visible",
  "scope": {
    "$ref": "#/properties/isVisible"
  }
}
@edgarmueller
Copy link
Contributor

No, currently not, but supporting this would make sense. I suppose, that the default value would only be used in case the respective data property is unset, correct? E.g., in this example, when binding an empty object { }, default's value would be used, but when binding against { isVisible: false } the default value would be ignored.

@chakraborty-slx
Copy link
Author

Yes that would be useful.

@koegel koegel added this to the Next milestone milestone May 29, 2017
@koegel
Copy link
Member

koegel commented Jun 9, 2017

This means opening a form on a JSON object will change the object without user interaction e.g. entering values into the form. I think this is not desirable. I would therefore propose a framework user should pre-initialize their JSON with default values before passing it into JSON Forms.

@eneufeld
Copy link
Member

@edgarmueller isn't this fixed via #1193 ?

@edgarmueller
Copy link
Contributor

It's not fixed, but we can close it as a duplicate of #1193

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

4 participants