code: def do_json_valid(self, params):
          
          def check_valid(path, print_path):
              result = "no"
              value, _ = self._zk.get(path)
  
              if value is not None:
                  try:
                      x = json.loads(value)
                      result = "yes"
                  except ValueError:
                      pass
  
              if print_path:
                  self.show_output("%s: %s.", os.path.basename(path), result)
              else:
                  self.show_output("%s.", result)
  
          if not params.recursive:
              check_valid(params.path, False)
          else:
              for cpath, _ in self._zk.tree(params.path, 0, full_path=True):
                  check_valid(cpath, True)
docs: \x1b[1mNAME\x1b[0m
          json_valid - Checks znodes for valid JSON
  
  \x1b[1mSYNOPSIS\x1b[0m
          json_valid <path> [recursive]
  
  \x1b[1mOPTIONS\x1b[0m
          * recursive: recurse to all children (default: false)
  
  \x1b[1mEXAMPLES\x1b[0m
          > json_valid /some/valid/json_znode
          yes.
  
          > json_valid /some/invalid/json_znode
          no.
  
          > json_valid /configs true
          /configs/a: yes.
          /configs/b: no.