Create a configuration dict for bravado_core based on pyramid_swagger
    settings.

    :param settings: pyramid registry settings with configuration for
        building a swagger schema
    :type settings: dict
    :returns: config dict suitable for passing into
        bravado_core.spec.Spec.from_dict(..)
    :rtype: dict

def create_bravado_core_config(settings):
    """Create a configuration dict for bravado_core based on pyramid_swagger
    settings.

    :param settings: pyramid registry settings with configuration for
        building a swagger schema
    :type settings: dict
    :returns: config dict suitable for passing into
        bravado_core.spec.Spec.from_dict(..)
    :rtype: dict
    """
    # Map pyramid_swagger config key -> bravado_core config key
    config_keys = {
        'pyramid_swagger.enable_request_validation': 'validate_requests',
        'pyramid_swagger.enable_response_validation': 'validate_responses',
        'pyramid_swagger.enable_swagger_spec_validation': 'validate_swagger_spec',
        'pyramid_swagger.use_models': 'use_models',
        'pyramid_swagger.user_formats': 'formats',
        'pyramid_swagger.include_missing_properties': 'include_missing_properties',
    }

    configs = {
        'use_models': False
    }

    bravado_core_configs_from_pyramid_swagger_configs = {
        bravado_core_key: settings[pyramid_swagger_key]
        for pyramid_swagger_key, bravado_core_key in iteritems(config_keys)
        if pyramid_swagger_key in settings
    }
    if bravado_core_configs_from_pyramid_swagger_configs:
        warnings.warn(
            message='Configs {old_configs} are deprecated, please use {new_configs} instead.'.format(
                old_configs=', '.join(k for k, v in sorted(iteritems(config_keys))),
                new_configs=', '.join(
                    '{}{}'.format(BRAVADO_CORE_CONFIG_PREFIX, v)
                    for k, v in sorted(iteritems(config_keys))
                ),
            ),
            category=DeprecationWarning,
        )
        configs.update(bravado_core_configs_from_pyramid_swagger_configs)

    configs.update({
        key.replace(BRAVADO_CORE_CONFIG_PREFIX, ''): value
        for key, value in iteritems(settings)
        if key.startswith(BRAVADO_CORE_CONFIG_PREFIX)
    })

    return configs