question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New properties not shown

See original GitHub issue

When updating JSON schema with new optional properties and then loading a JSON which does not have that optional properties, they are not shown in the editor.

How to reproduce: Go to http://jeremydorn.com/json-editor/ and add this property to the person object’s properties in the JSON schema:

    "title": {
      "type": "string",
      "description": "Title"
    },

and then click on “Update Schema”

The new property will be visible in the form and the JSON Output will be refreshed:

{
  "name": "Jeremy Dorn",
  "title": "",
  "age": 25,
  "favorite_color": "#ffa500",
  "gender": "male",
  "location": {
    "city": "San Francisco",
    "state": "CA",
    "citystate": "San Francisco, CA"
  },
  "pets": [
    {
      "type": "dog",
      "name": "Walter"
    }
  ]
}

Delete this from the JSON output and click on “update form”:

  "title": "",

Now the “title” property will not be shown anymore. Any ideas on how to solve this issue? Thank you

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
radswiatcommented, Sep 26, 2016

Quick and temporary solution - remove the line below ( // REMOVED => )

`
setValue: function(value, initial) { var self = this; value = value || {};

        if(typeof value !== "object" || Array.isArray(value)) value = {};

        // First, set the values for all of the defined properties
        $each(this.cached_editors, function(i,editor) {
            // Value explicitly set
            if(typeof value[i] !== "undefined") {
                self.addObjectProperty(i);
                editor.setValue(value[i],initial);
            }
            // Otherwise, remove value unless this is the initial set or it's required
            else if(!initial && !self.isRequired(editor)) {
                // REMOVED => self.removeObjectProperty(i);
            }
            // Otherwise, set the value to the default
            else {
                editor.setValue(editor.getDefault(),initial);
            }
        });`
0reactions
emilb604commented, Mar 7, 2018

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Properties window is not displaying properly and not showing
Properties window is not displaying properly and not showing information. I recently downloaded Greenshot from https://getgreenshot.org/.
Read more >
New Property not showing in edit mode - Optimizely World
Hi there,. Working on an existing block,. [Display(Name = "string 1", GroupName = SystemTabNames.Content, Order = 10)] [CultureSpecific]
Read more >
Properties window not showing in AutoCAD
The properties palette does not show within the program even when using the PROPERTIES command.
Read more >
Why when adding new properties to custom control the ...
The custom property is shown in the "Properties" tab of the PropertyGrid control, in its own "Extended Properties" category (naturally, ...
Read more >
Object.defineProperty() - JavaScript - MDN Web Docs
defineProperty() defines a new property directly on an object, or modifies an existing property on an object, and returns the object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found