def _to_pickleable_representation(model_name, model_type):
    """
    Extract a pickleable representation of the input Model type.

    Model types are runtime created types and so they are not pickleable.
    In order to workaround this limitation we extract a representation,
    which is pickleable such that we can re-create the input Model type
    (via ``_from_pickleable_representation``).

    NOTE:   This API should not be considered a public API and is meant
            only to be used by bravado_core.spec.Spec.__getstate__ .
    """
    return {'swagger_spec': model_type._swagger_spec, 'model_name':
        model_name, 'model_spec': model_type._model_spec, 'bases':
        model_type.__bases__, 'json_reference': model_type._json_reference}
