def do_json_set(self, params):
        """
\x1b[1mNAME\x1b[0m
        json_set - Sets the value for the given (possibly nested) key on a JSON object serialized in the given path

\x1b[1mSYNOPSIS\x1b[0m
        json_set <path> <keys> <value> <value_type> [confirm]

\x1b[1mDESCRIPTION\x1b[0m
        If the key exists and the value is different, the znode will be updated with the key set to its new value.
        If the key does not exist, it'll be created and the znode will be updated with the serialized version of
        the new object. The value's type will be determined by the value_type parameter.

\x1b[1mEXAMPLES\x1b[0m
        > create /props '{"a": {"b": 4}}'
        > json_cat /props
        {
            "a": {
                "b": 4
            }
        }
        > json_set /props a.b 5 int
        > json_cat /props
        {
            "a": {
                "b": 5
            }
        }
        > json_set /props a.c.d true bool
        > json_cat /props
        {
            "a": {
                "c": {
                    "d": true
                },
                "b": 5
            }
        }

        """
        try:
            Keys.validate(params.keys)
        except Keys.Bad as ex:
            self.show_output(str(ex))
            return

        try:
            jstr, stat = self._zk.get(params.path)
            obj_src = json_deserialize(jstr)
            obj_dst = copy.deepcopy(obj_src)

            # Cast value to its given type.
            value = to_type(params.value, params.value_type)
            Keys.set(obj_dst, params.keys, value)

            if params.confirm:
                a = json.dumps(obj_src, sort_keys=True, indent=4)
                b = json.dumps(obj_dst, sort_keys=True, indent=4)
                diff = difflib.unified_diff(a.split("\n"), b.split("\n"))
                self.show_output("\n".join(diff))
                if not self.prompt_yes_no("Apply update?"):
                    return

            # Pass along the read version, to ensure we are updating what we read.
            self.set(params.path, json.dumps(obj_dst), version=stat.version)
        except BadJSON:
            self.show_output("Path %s has bad JSON.", params.path)
        except Keys.Missing as ex:
            self.show_output("Path %s is missing key %s.", params.path, ex)
        except ValueError:
            self.show_output("Bad value_type")