docs: def api_declaration(
              cls, request,
              api_path: (Ptypes.path,
                         String('The path for the info on the resource.'))) -> [
              (200, 'Ok', ApiDeclarationModel),
              (404, 'Not a valid resource.')]:
          '''Return the complete specification of a single API.
  
          Resources are filtered according to the permission system, so querying
          this resource as different users may bare different results.
          '''
          if api_path in cls.__cache:
              Respond(200, cls.__cache[api_path])
          # Select the resources belonging to this API
          resources = tuple(filter(lambda ep: ep.api.path == api_path, Resource))
          if not resources:
              Respond(404)
          apis = [r.get_swagger_fragment() for r in resources if not r.private]
          cls.__cache[api_path] = {
              'apiVersion': cls.api.version,
              'swaggerVersion': cls.api.swagger_version,
              'basePath': request.url_root[:-1],  # Remove trailing slash
              'resourcePath': '/{}'.format(api_path),
              'apis': apis,
              'models': cls._extract_models(apis),
              'consumes': ['application/json'],
              'produces': ['application/json']
          }
          Respond(200, cls.__cache[api_path])