rodikh/angular-json-editor

display_required_only in JSONEditorProvider ignored?

danwf opened this issue · 4 comments

danwf commented

The GUI seems to behave as if this value is always set to true. Meaning, the editor always displays only the properties marked required in the schema, and you have to go into 'Properties' and check off all the non-required ones,

Other properties like disable_edit_json work fine.

Does this behaviour exist in the original jdorn/json-editor?
We can't change the core functionality of the editor in this repo, only bump up the required version of jdorn/json-editor

danwf commented

I just ran a test. The display_required_only flag works as intended using only the original jdorn/json-editor, but behaves how I described in the OP when using the angular-json-editor.

To me, the strangest thing about this is that the angular-json-editor is behaving as if the flag is always true, whereas it's meant to default to false.

Have the same problem, any suggestion how to solve it?

Are you incidentally setting a startVal that omits the specific field you're not seeing?
It seems that the original json-editor only checks the display_required_only flag when creating the editor, but not when updating it with values.

Please reopen if your case is not as described.