def get_descriptor_defaults(self, api_info, hostname=None, x_google_api_name=False):
    """Gets a default configuration for a service.

    Args:
      api_info: _ApiInfo object for this service.
      hostname: string, Hostname of the API, to override the value set on the
        current service. Defaults to None.

    Returns:
      A dictionary with the default configuration.
    """
    hostname = (hostname or util.get_app_hostname() or
                api_info.hostname)
    protocol = 'http' if ((hostname and hostname.startswith('localhost')) or
                          util.is_running_on_devserver()) else 'https'
    base_path = api_info.base_path
    if base_path != '/':
        base_path = base_path.rstrip('/')
    defaults = {
        'swagger': '2.0',
        'info': {
            'version': api_info.api_version,
            'title': api_info.name
        },
        'host': hostname,
        'consumes': ['application/json'],
        'produces': ['application/json'],
        'schemes': [protocol],
        'basePath': base_path,
    }

    if x_google_api_name:
        defaults['x-google-api-name'] = _validate_api_name(api_info.name)

    return defaults
def get_descriptor_defaults ( self , api_info , hostname = None , x_google_api_name = False ) : hostname = ( hostname or util . get_app_hostname ( ) or api_info . hostname ) protocol = 'http' if ( ( hostname and hostname . startswith ( 'localhost' ) ) or util . is_running_on_devserver ( ) ) else 'https' base_path = api_info . base_path if base_path != '/' : base_path = base_path . rstrip ( '/' ) defaults = { 'swagger' : '2.0' , 'info' : { 'version' : api_info . api_version , 'title' : api_info . name } , 'host' : hostname , 'consumes' : [ 'application/json' ] , 'produces' : [ 'application/json' ] , 'schemes' : [ protocol ] , 'basePath' : base_path , } if x_google_api_name : defaults [ 'x-google-api-name' ] = _validate_api_name ( api_info . name ) return defaults
Gets a default configuration for a service.

    Args:
      api_info: _ApiInfo object for this service.
      hostname: string, Hostname of the API, to override the value set on the
        current service. Defaults to None.

    Returns:
      A dictionary with the default configuration.