public async getSpecificationLink()

in src/util/useApiService.ts [40:57]


    public async getSpecificationLink(apiName: string, versionName: string, definitionName: string): Promise<string> {
        const url = `apis/${apiName}/versions/${versionName}/definitions/${definitionName}:exportSpecification`;

        if (this.requestCache.has(url)) {
            return this.requestCache.get(url)!; // Non-null assertion (!) since we know it exists
        }

        const responsePromise =  this.httpClient(url, Method.POST)
            .then(response => response.value)
            .catch(error => {
                this.requestCache.delete(url);
                return Promise.reject(error);
            });
            
        this.requestCache.set(url, responsePromise);

        return responsePromise;
    }