# Path: nativeconfig/exceptions.py
# class ValidationError(OptionError):
#     def __init__(self, msg, value, option_name):
#         self.value = value
#         super().__init__(msg, option_name)
# 
# class DeserializationError(OptionError):
#     def __init__(self, msg, raw_value, option_name):
#         self.raw_value = raw_value
#         super().__init__(msg, option_name)


from abc import ABCMeta
from collections.abc import Iterable
from enum import Enum
from nativeconfig.exceptions import ValidationError, DeserializationError
import copy
import json
import logging
import os
import sys

        @see: serialize

        @raise DeserializationError: Raise if value cannot be deserialized.
        """
        return str(raw_value)

    def serialize_json(self, python_value):
        """
        Serialize Python Value into JSON Value.

        Custom implementation should properly handle None as a python_value.

        @see: deserialize_json

        @rtype: str
        """
        return json.dumps(python_value)

    def deserialize_json(self, json_value):
        """
        Deserialize JSON Value into Python Value.

        Custom implementation should properly handle None as a python_value.

        @see: serialize_json
        """
        try:
            return json.loads(json_value)
        except ValueError:

# Path: nativeconfig/exceptions.py
# class ValidationError(OptionError):
#     def __init__(self, msg, value, option_name):
#         self.value = value
#         super().__init__(msg, option_name)
# 
# class DeserializationError(OptionError):
#     def __init__(self, msg, raw_value, option_name):
#         self.raw_value = raw_value
#         super().__init__(msg, option_name)


# Path: nativeconfig/options/base_option.py
from abc import ABCMeta
from collections.abc import Iterable
from enum import Enum
from nativeconfig.exceptions import ValidationError, DeserializationError
import copy
import json
import logging
import os
import sys


        @see: serialize

        @raise DeserializationError: Raise if value cannot be deserialized.
        """
        return str(raw_value)

    def serialize_json(self, python_value):
        """
        Serialize Python Value into JSON Value.

        Custom implementation should properly handle None as a python_value.

        @see: deserialize_json

        @rtype: str
        """
        return json.dumps(python_value)

    def deserialize_json(self, json_value):
        """
        Deserialize JSON Value into Python Value.

        Custom implementation should properly handle None as a python_value.

        @see: serialize_json
        """
        try:
            return json.loads(json_value)
        except ValueError:

            raise DeserializationError("'{}' is invalid JSON".format(json_value), json_value, self.name)