import json

from .base_serializer import BaseSerializer


class JsonSerializer(BaseSerializer):
    '''Json serializer.'''

    def _serialize(self, data: dict, **kwargs) -> str:
        return json.dumps(data)

    def _deserialize(self, data: str, **kwargs) -> dict:
        return json.loads(data)

[((10, 15, 10, 31), 'json.dumps', 'json.dumps', ({(10, 26, 10, 30): 'data'}, {}), '(data)', False, 'import json\n'), ((13, 15, 13, 31), 'json.loads', 'json.loads', ({(13, 26, 13, 30): 'data'}, {}), '(data)', False, 'import json\n')]