code: def json(self):
          
          json_dumps = json.dumps(
              self.dict,
              indent=2,
              sort_keys=True,
              separators=(',', ': '),
              cls=MetadataEncoder
          )
          if not json_dumps.endswith('\n'):
              json_dumps += '\n'
          return json_dumps
docs: json representation of the metadata.
  
          :return: json representation of the metadata
          :rtype: str