def add_api(self, swagger_file, base_path=None, arguments=None, auth_all_paths=None, swagger_json=None,
                swagger_ui=None, swagger_path=None, swagger_url=None, validate_responses=False,
                resolver=Resolver()):
        """
        Adds an API to the application based on a swagger file

        :param swagger_file: swagger file with the specification
        :type swagger_file: pathlib.Path
        :param base_path: base path where to add this api
        :type base_path: str | None
        :param arguments: api version specific arguments to replace on the specification
        :type arguments: dict | None
        :param auth_all_paths: whether to authenticate not defined paths
        :type auth_all_paths: bool
        :param swagger_json: whether to include swagger json or not
        :type swagger_json: bool
        :param swagger_ui: whether to include swagger ui or not
        :type swagger_ui: bool
        :param swagger_path: path to swagger-ui directory
        :type swagger_path: string | None
        :param swagger_url: URL to access swagger-ui documentation
        :type swagger_url: string | None
        :param validate_responses: True enables validation. Validation errors generate HTTP 500 responses.
        :type validate_responses: bool
        :param resolver: Operation resolver.
        :type resolver: Resolver | types.FunctionType
        :rtype: Api
        """
        resolver = Resolver(resolver) if hasattr(resolver, '__call__') else resolver

        swagger_json = swagger_json if swagger_json is not None else self.swagger_json
        swagger_ui = swagger_ui if swagger_ui is not None else self.swagger_ui
        swagger_path = swagger_path if swagger_path is not None else self.swagger_path
        swagger_url = swagger_url if swagger_url is not None else self.swagger_url
        auth_all_paths = auth_all_paths if auth_all_paths is not None else self.auth_all_paths
        logger.debug('Adding API: %s', swagger_file)
        # TODO test if base_url starts with an / (if not none)
        arguments = arguments or dict()
        arguments = dict(self.arguments, **arguments)  # copy global arguments and update with api specfic
        yaml_path = self.specification_dir / swagger_file
        api = Api(swagger_yaml_path=yaml_path,
                  base_url=base_path, arguments=arguments,
                  swagger_json=swagger_json,
                  swagger_ui=swagger_ui,
                  swagger_path=swagger_path,
                  swagger_url=swagger_url,
                  resolver=resolver,
                  validate_responses=validate_responses,
                  auth_all_paths=auth_all_paths,
                  debug=self.debug)
        self.app.register_blueprint(api.blueprint)
        return api
dataset/ETHPy150Open zalando/connexion/connexion/app.py/App.add_api/original