This is a bit tricky, as JSON validation does not allow a type string to become null.
One workaround is to make field with two possible types (see json-editor/json-editor#649)
but this creates a strange dropdown.
Unfortunately, I think this must be handled using JS...