def register_json():
 from anyjson import loads as json_loads, dumps as json_dumps
 def _loads(obj):
  if isinstance(obj, bytes_t):
   obj = obj.decode()
  return json_loads(obj)
 registry.register('json', json_dumps, _loads, content_type='application/json', content_encoding='utf-8')

def register_json ( ) : from anyjson import loads as json_loads , dumps as json_dumps def _loads ( obj ) : if isinstance ( obj , bytes_t ) : obj = obj . decode ( ) return json_loads ( obj ) registry . register ( 'json' , json_dumps , _loads , content_type = 'application/json' , content_encoding = 'utf-8' )
register a encoder/decoder for json serialization .