From b83be1d9ca3eba74744039dd746d74a6bfb9ed9c Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 2 Dec 2024 20:48:49 +0100 Subject: [PATCH 01/59] chore: append basePath to path pattern in openapi generator --- .../src/file-serializer/api-file.ts | 12 ++++- .../src/file-serializer/operation.spec.ts | 48 +++++++++++++++++++ .../src/file-serializer/operation.ts | 12 ++++- packages/openapi-generator/src/generator.ts | 2 +- 4 files changed, 69 insertions(+), 5 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index baf8062340..c17af3ef9e 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -16,25 +16,33 @@ import type { * Serialize an API representation to a string representing the resulting API file. * @param api - Representation of an API. * @param serviceName - Service name for which the API is created. + * @param options - Options to configure the file creation. + * @param basePath - Base path for the API obtained from optionsPerService. * @returns The serialized API file contents. * @internal */ export function apiFile( api: OpenApiApi, serviceName: string, - options?: CreateFileOptions + options?: CreateFileOptions, + basePath?: string ): string { const imports = serializeImports(getImports(api, options)); const apiDoc = apiDocumentation(api, serviceName); + const santisiedBasePath = getSantisiedBasePath(basePath); const apiContent = codeBlock` export const ${api.name} = { - ${api.operations.map(operation => serializeOperation(operation)).join(',\n')} + ${api.operations.map(operation => serializeOperation(operation, santisiedBasePath)).join(',\n')} }; `; return [imports, apiDoc, apiContent].join(unixEOL); } +function getSantisiedBasePath(basePath: string | undefined) { + return basePath ? basePath.replace(/^\/+/, '') + '/' : ''; +} + /** * Get the unique reference schemas for all request body types in the given operation list. * @param operations - The given operation list. diff --git a/packages/openapi-generator/src/file-serializer/operation.spec.ts b/packages/openapi-generator/src/file-serializer/operation.spec.ts index e2500747d7..e5ea382267 100644 --- a/packages/openapi-generator/src/file-serializer/operation.spec.ts +++ b/packages/openapi-generator/src/file-serializer/operation.spec.ts @@ -72,6 +72,54 @@ describe('serializeOperation', () => { `); }); + it('serializes operation by appending base path to the path pattern', () => { + const operation: OpenApiOperation = { + operationId: 'getFn', + method: 'get', + tags: [], + pathParameters: [ + { + in: 'path', + name: 'id', + originalName: 'id', + schema: { type: 'string' }, + required: true, + schemaProperties: {} + }, + { + in: 'path', + name: 'subId', + originalName: 'subId', + schema: { type: 'string' }, + required: true, + schemaProperties: {} + } + ], + queryParameters: [], + headerParameters: [], + responses: { 200: { description: 'some response description' } }, + response: { type: 'string' }, + pathPattern: 'test/{id}/{subId}' + }; + const santisedBasePath = 'base/path/'; + expect(serializeOperation(operation, santisedBasePath)) + .toMatchInlineSnapshot(` + "/** + * Create a request builder for execution of get requests to the 'test/{id}/{subId}' endpoint. + * @param id - Path parameter. + * @param subId - Path parameter. + * @returns The request builder, use the \`execute()\` method to trigger the request. + */ + getFn: (id: string, subId: string) => new OpenApiRequestBuilder( + 'get', + "base/path/test/{id}/{subId}", + { + pathParameters: { id, subId } + } + )" + `); + }); + it('serializes operation with path and header parameters', () => { const operation: OpenApiOperation = { operationId: 'deleteFn', diff --git a/packages/openapi-generator/src/file-serializer/operation.ts b/packages/openapi-generator/src/file-serializer/operation.ts index dfa41663d2..e562461ffd 100644 --- a/packages/openapi-generator/src/file-serializer/operation.ts +++ b/packages/openapi-generator/src/file-serializer/operation.ts @@ -9,13 +9,21 @@ import type { /** * Serialize an operation to a string. * @param operation - Operation to serialize. + * @param santisedBasePath - Sanitised base path from optionsPerService that needs to be prefixed to the operation path pattern. * @returns The operation as a string. * @internal */ -export function serializeOperation(operation: OpenApiOperation): string { +export function serializeOperation( + operation: OpenApiOperation, + santisiedBasePath?: string +): string { + const pathPatternWithBasePath = santisiedBasePath + ? `${santisiedBasePath}${operation.pathPattern}` + : operation.pathPattern; + const requestBuilderParams = [ `'${operation.method}'`, - `"${operation.pathPattern}"` + `"${pathPatternWithBasePath}"` ]; const bodyAndQueryParams = serializeParamsForRequestBuilder(operation); diff --git a/packages/openapi-generator/src/generator.ts b/packages/openapi-generator/src/generator.ts index 73ce07f6d9..22339f6270 100644 --- a/packages/openapi-generator/src/generator.ts +++ b/packages/openapi-generator/src/generator.ts @@ -223,7 +223,7 @@ async function createApis( createFile( serviceDir, `${kebabCase(api.name)}.ts`, - apiFile(api, openApiDocument.serviceName, options), + apiFile(api, openApiDocument.serviceName, options, openApiDocument.serviceOptions.basePath), options ) ) From 43576b8c1a43ceeb78c4449dbc0499f81b217b3f Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 2 Dec 2024 21:12:18 +0100 Subject: [PATCH 02/59] chore: switch to using removeSlashes from util --- .../src/file-serializer/api-file.ts | 14 +++++------ packages/util/src/remove-slashes.spec.ts | 24 +++++++++++++++++++ packages/util/src/remove-slashes.ts | 5 ++-- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 packages/util/src/remove-slashes.spec.ts diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index c17af3ef9e..d53b95f291 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -1,4 +1,9 @@ -import { codeBlock, documentationBlock, unixEOL } from '@sap-cloud-sdk/util'; +import { + codeBlock, + documentationBlock, + removeSlashes, + unixEOL +} from '@sap-cloud-sdk/util'; import { serializeImports } from '@sap-cloud-sdk/generator-common/internal'; import { collectRefs, getUniqueRefs } from '../schema-util'; import { serializeOperation } from './operation'; @@ -29,7 +34,7 @@ export function apiFile( ): string { const imports = serializeImports(getImports(api, options)); const apiDoc = apiDocumentation(api, serviceName); - const santisiedBasePath = getSantisiedBasePath(basePath); + const santisiedBasePath = basePath ? removeSlashes(basePath) + '/' : ''; const apiContent = codeBlock` export const ${api.name} = { ${api.operations.map(operation => serializeOperation(operation, santisiedBasePath)).join(',\n')} @@ -38,11 +43,6 @@ export const ${api.name} = { return [imports, apiDoc, apiContent].join(unixEOL); } - -function getSantisiedBasePath(basePath: string | undefined) { - return basePath ? basePath.replace(/^\/+/, '') + '/' : ''; -} - /** * Get the unique reference schemas for all request body types in the given operation list. * @param operations - The given operation list. diff --git a/packages/util/src/remove-slashes.spec.ts b/packages/util/src/remove-slashes.spec.ts new file mode 100644 index 0000000000..7b93bb29f5 --- /dev/null +++ b/packages/util/src/remove-slashes.spec.ts @@ -0,0 +1,24 @@ +import { + removeSlashes, + removeLeadingSlashes, + removeTrailingSlashes +} from './remove-slashes'; + +describe('removeSlashes', () => { + it('removes trailing slashes', () => { + expect(removeSlashes('/test/')).toBe('test'); + }); + it('removes leading slashes', () => { + expect(removeLeadingSlashes('/test')).toBe('test'); + }); + it('removes multiple leading slashes', () => { + expect(removeLeadingSlashes('///test/')).toBe('test/'); + }); + it('removes trailing slashes', () => { + expect(removeTrailingSlashes('/test/')).toBe('/test'); + }); + + it('removes multiple trailing slashes', () => { + expect(removeTrailingSlashes('/test///')).toBe('/test'); + }); +}); diff --git a/packages/util/src/remove-slashes.ts b/packages/util/src/remove-slashes.ts index 953ad20433..74e8b2fe09 100644 --- a/packages/util/src/remove-slashes.ts +++ b/packages/util/src/remove-slashes.ts @@ -11,12 +11,13 @@ export function removeSlashes(path: string): string { * @internal */ export function removeTrailingSlashes(path: string): string { - return path.endsWith('/') ? path.slice(0, -1) : path; + return path.replace(/\/+$/, ''); } /** * @internal */ export function removeLeadingSlashes(path: string): string { - return path.startsWith('/') ? path.slice(1) : path; + return path.replace(/^\/+/,''); } + From 497f40c87ed7ca53659a2d5e1cb9747b39842a99 Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 2 Dec 2024 21:40:54 +0100 Subject: [PATCH 03/59] chore: add additional test --- .../__snapshots__/api-file.spec.ts.snap | 39 +++++++++++++++++++ .../src/file-serializer/api-file.spec.ts | 11 ++++++ .../src/file-serializer/operation.ts | 2 +- packages/util/src/remove-slashes.ts | 3 +- 4 files changed, 52 insertions(+), 3 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap index 57cb322d05..7e6290e59e 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap @@ -103,6 +103,45 @@ export const TestApi = { };" `; +exports[`api-file serializes api file with multiple operations and references and base path 1`] = ` +"import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; +import type { QueryParameterType, RefType, ResponseType } from './schema'; +/** + * Representation of the 'TestApi'. + * This API is part of the 'MyServiceName' service. + */ +export const TestApi = { + /** + * Create a request builder for execution of get requests to the 'test/{id}' endpoint. + * @param id - Path parameter. + * @param queryParameters - Object containing the following keys: queryParam. + * @param headerParameters - Object containing the following keys: headerParam. + * @returns The request builder, use the \`execute()\` method to trigger the request. + */ + getFn: (id: string, queryParameters: {'queryParam': QueryParameterType}, headerParameters?: {'headerParam'?: string}) => new OpenApiRequestBuilder( + 'get', + "base/path/to/service/test/{id}", + { + pathParameters: { id }, + queryParameters, + headerParameters + } + ), + /** + * Create a request builder for execution of post requests to the 'test' endpoint. + * @param body - Request body. + * @returns The request builder, use the \`execute()\` method to trigger the request. + */ + createFn: (body: RefType) => new OpenApiRequestBuilder( + 'post', + "base/path/to/service/test", + { + body + } + ) +};" +`; + exports[`api-file serializes api file with one operation and no references 1`] = ` "import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; /** diff --git a/packages/openapi-generator/src/file-serializer/api-file.spec.ts b/packages/openapi-generator/src/file-serializer/api-file.spec.ts index 91a925f79c..05c2be094a 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.spec.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.spec.ts @@ -124,6 +124,17 @@ describe('api-file', () => { expect(apiFile(multipleOperationApi, 'MyServiceName')).toMatchSnapshot(); }); + it('serializes api file with multiple operations and references and base path', () => { + expect( + apiFile( + multipleOperationApi, + 'MyServiceName', + undefined, + '///base/path/to/service///' + ) + ).toMatchSnapshot(); + }); + it('creates an api file with documentation', () => { expect(apiFile(docsApi, 'TestService')).toMatchSnapshot(); }); diff --git a/packages/openapi-generator/src/file-serializer/operation.ts b/packages/openapi-generator/src/file-serializer/operation.ts index e562461ffd..025d69bef9 100644 --- a/packages/openapi-generator/src/file-serializer/operation.ts +++ b/packages/openapi-generator/src/file-serializer/operation.ts @@ -9,7 +9,7 @@ import type { /** * Serialize an operation to a string. * @param operation - Operation to serialize. - * @param santisedBasePath - Sanitised base path from optionsPerService that needs to be prefixed to the operation path pattern. + * @param santisedBasePath - Sanitised base path(leading slashes removed and only contains one trailing slash) from optionsPerService that gets prefixed to the operation path pattern. * @returns The operation as a string. * @internal */ diff --git a/packages/util/src/remove-slashes.ts b/packages/util/src/remove-slashes.ts index 74e8b2fe09..67ef8bcb1c 100644 --- a/packages/util/src/remove-slashes.ts +++ b/packages/util/src/remove-slashes.ts @@ -18,6 +18,5 @@ export function removeTrailingSlashes(path: string): string { * @internal */ export function removeLeadingSlashes(path: string): string { - return path.replace(/^\/+/,''); + return path.replace(/^\/+/, ''); } - From c203aa7a2ceba816077ac4601b386d24f7b16372 Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 2 Dec 2024 21:42:03 +0100 Subject: [PATCH 04/59] chore: check-public-api change --- .github/actions/check-public-api/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/check-public-api/index.js b/.github/actions/check-public-api/index.js index 894575dfba..28ea4c2444 100644 --- a/.github/actions/check-public-api/index.js +++ b/.github/actions/check-public-api/index.js @@ -74871,13 +74871,13 @@ function removeSlashes(path) { * @internal */ function removeTrailingSlashes(path) { - return path.endsWith('/') ? path.slice(0, -1) : path; + return path.replace(/\/+$/, ''); } /** * @internal */ function removeLeadingSlashes(path) { - return path.startsWith('/') ? path.slice(1) : path; + return path.replace(/^\/+/, ''); } //# sourceMappingURL=remove-slashes.js.map From 4d72e6a031cad0705abc62326b1eae1c3227411a Mon Sep 17 00:00:00 2001 From: cloud-sdk-js Date: Tue, 3 Dec 2024 08:51:16 +0000 Subject: [PATCH 05/59] Changes from lint:fix --- packages/openapi-generator/src/generator.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/openapi-generator/src/generator.ts b/packages/openapi-generator/src/generator.ts index 22339f6270..0d810696f1 100644 --- a/packages/openapi-generator/src/generator.ts +++ b/packages/openapi-generator/src/generator.ts @@ -223,7 +223,12 @@ async function createApis( createFile( serviceDir, `${kebabCase(api.name)}.ts`, - apiFile(api, openApiDocument.serviceName, options, openApiDocument.serviceOptions.basePath), + apiFile( + api, + openApiDocument.serviceName, + options, + openApiDocument.serviceOptions.basePath + ), options ) ) From de355ebf72a70aef1609a70433d48a6b96529e2e Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 3 Dec 2024 10:45:29 +0100 Subject: [PATCH 06/59] chore: update test --- packages/openapi-generator/src/generator.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/openapi-generator/src/generator.spec.ts b/packages/openapi-generator/src/generator.spec.ts index 3513e1cef3..8e3ed659d2 100644 --- a/packages/openapi-generator/src/generator.spec.ts +++ b/packages/openapi-generator/src/generator.spec.ts @@ -212,7 +212,7 @@ describe('generator', () => { }) }, existingConfig: - '{ "inputDir/spec.json": {"directoryName": "customName" } }', + '{ "inputDir/spec.json": {"directoryName": "customName" , "basePath": "/base/path/for/service" } }', anotherConfig: '{ "inputDir/spec2.json": {"directoryName": "customName" } }' }); @@ -251,7 +251,8 @@ describe('generator', () => { await expect(JSON.parse(actual)).toEqual({ 'inputDir/spec.json': { packageName: 'customname', - directoryName: 'customName' + directoryName: 'customName', + basePath: '/base/path/for/service' } }); }); From 91c69f89531cd4b92e9a2567c600a3e2894d7d91 Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 3 Dec 2024 23:06:01 +0100 Subject: [PATCH 07/59] chore: adjust all tests --- .../__snapshots__/api-file.spec.ts.snap | 8 +- .../__snapshots__/operation.spec.ts.snap | 4 +- .../src/file-serializer/api-file.ts | 2 +- .../src/file-serializer/operation.spec.ts | 80 ++++++------ .../src/file-serializer/operation.ts | 21 ++- .../generate-openapi-services.ts | 23 +++- .../test-service/default-api.d.ts | 4 +- .../test-service/default-api.js | 8 +- .../test-service/default-api.js.map | 2 +- .../test-service/default-api.ts | 15 ++- .../test-service/entity-api.d.ts | 6 +- .../test-service/entity-api.js | 22 ++-- .../test-service/entity-api.js.map | 2 +- .../test-service/entity-api.ts | 42 +++--- .../test-service/extension-api.d.ts | 4 +- .../test-service/extension-api.js | 8 +- .../test-service/extension-api.js.map | 2 +- .../test-service/extension-api.ts | 14 +- .../test-service/tag-dot-api.d.ts | 2 +- .../test-service/tag-dot-api.js | 4 +- .../test-service/tag-dot-api.js.map | 2 +- .../test-service/tag-dot-api.ts | 7 +- .../test-service/tag-space-api.d.ts | 2 +- .../test-service/tag-space-api.js | 4 +- .../test-service/tag-space-api.js.map | 2 +- .../test-service/tag-space-api.ts | 7 +- .../test-service/test-case-api.d.ts | 30 ++--- .../test-service/test-case-api.js | 60 ++++----- .../test-service/test-case-api.js.map | 2 +- .../test-service/test-case-api.ts | 121 +++++++++++------- .../options-per-service.json | 7 + 31 files changed, 304 insertions(+), 213 deletions(-) create mode 100644 test-resources/openapi-service-specs/options-per-service.json diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap index 7e6290e59e..7a68d26484 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap @@ -112,7 +112,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; */ export const TestApi = { /** - * Create a request builder for execution of get requests to the 'test/{id}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/servicetest/{id}' endpoint. * @param id - Path parameter. * @param queryParameters - Object containing the following keys: queryParam. * @param headerParameters - Object containing the following keys: headerParam. @@ -120,7 +120,7 @@ export const TestApi = { */ getFn: (id: string, queryParameters: {'queryParam': QueryParameterType}, headerParameters?: {'headerParam'?: string}) => new OpenApiRequestBuilder( 'get', - "base/path/to/service/test/{id}", + "/base/path/to/servicetest/{id}", { pathParameters: { id }, queryParameters, @@ -128,13 +128,13 @@ export const TestApi = { } ), /** - * Create a request builder for execution of post requests to the 'test' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/servicetest' endpoint. * @param body - Request body. * @returns The request builder, use the \`execute()\` method to trigger the request. */ createFn: (body: RefType) => new OpenApiRequestBuilder( 'post', - "base/path/to/service/test", + "/base/path/to/servicetest", { body } diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/operation.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/operation.spec.ts.snap index 994c848701..cb3a2560fc 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/operation.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/operation.spec.ts.snap @@ -2,13 +2,13 @@ exports[`serializeOperation serializes operation with path parameters inside () 1`] = ` "/** - * Create a request builder for execution of get requests to the 'test('{id}')' endpoint. + * Create a request builder for execution of get requests to the '/test('{id}')' endpoint. * @param id - Path parameter. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (id: string) => new OpenApiRequestBuilder>( 'get', - "test('{id}')", + "/test('{id}')", { pathParameters: { id } } diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index d53b95f291..8aa9e43476 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -34,7 +34,7 @@ export function apiFile( ): string { const imports = serializeImports(getImports(api, options)); const apiDoc = apiDocumentation(api, serviceName); - const santisiedBasePath = basePath ? removeSlashes(basePath) + '/' : ''; + const santisiedBasePath = basePath ? '/' + removeSlashes(basePath) : ''; const apiContent = codeBlock` export const ${api.name} = { ${api.operations.map(operation => serializeOperation(operation, santisiedBasePath)).join(',\n')} diff --git a/packages/openapi-generator/src/file-serializer/operation.spec.ts b/packages/openapi-generator/src/file-serializer/operation.spec.ts index e5ea382267..de1e0547e0 100644 --- a/packages/openapi-generator/src/file-serializer/operation.spec.ts +++ b/packages/openapi-generator/src/file-serializer/operation.spec.ts @@ -49,11 +49,11 @@ describe('serializeOperation', () => { ], responses: { 200: { description: 'some response description' } }, response: { type: 'string' }, - pathPattern: 'test/{id}/{subId}' + pathPattern: '/test/{id}/{subId}' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of get requests to the 'test/{id}/{subId}' endpoint. + * Create a request builder for execution of get requests to the '/test/{id}/{subId}' endpoint. * @param id - Path parameter. * @param subId - Path parameter. * @param queryParameters - Object containing the following keys: limit. @@ -62,7 +62,7 @@ describe('serializeOperation', () => { */ getFn: (id: string, subId: string, queryParameters?: {'limit'?: number}, headerParameters?: {'resource-group'?: string}) => new OpenApiRequestBuilder( 'get', - "test/{id}/{subId}", + "/test/{id}/{subId}", { pathParameters: { id, subId }, queryParameters, @@ -99,20 +99,20 @@ describe('serializeOperation', () => { headerParameters: [], responses: { 200: { description: 'some response description' } }, response: { type: 'string' }, - pathPattern: 'test/{id}/{subId}' + pathPattern: '/test/{id}/{subId}' }; - const santisedBasePath = 'base/path/'; + const santisedBasePath = '/base/path'; expect(serializeOperation(operation, santisedBasePath)) .toMatchInlineSnapshot(` "/** - * Create a request builder for execution of get requests to the 'test/{id}/{subId}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/test/{id}/{subId}' endpoint. * @param id - Path parameter. * @param subId - Path parameter. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (id: string, subId: string) => new OpenApiRequestBuilder( 'get', - "base/path/test/{id}/{subId}", + "/base/path/test/{id}/{subId}", { pathParameters: { id, subId } } @@ -150,19 +150,19 @@ describe('serializeOperation', () => { additionalProperties: { type: 'any' }, properties: [] }, - pathPattern: 'test/{id}' + pathPattern: '/test/{id}' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of delete requests to the 'test/{id}' endpoint. + * Create a request builder for execution of delete requests to the '/test/{id}' endpoint. * @param id - Path parameter. * @param headerParameters - Object containing the following keys: resource-group. * @returns The request builder, use the \`execute()\` method to trigger the request. */ deleteFn: (id: string, headerParameters?: {'resource-group'?: string}) => new OpenApiRequestBuilder>( 'delete', - "test/{id}", + "/test/{id}", { pathParameters: { id }, headerParameters @@ -193,18 +193,18 @@ describe('serializeOperation', () => { additionalProperties: { type: 'any' }, properties: [] }, - pathPattern: 'test/{id}' + pathPattern: '/test/{id}' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of delete requests to the 'test/{id}' endpoint. + * Create a request builder for execution of delete requests to the '/test/{id}' endpoint. * @param id - Path parameter. * @returns The request builder, use the \`execute()\` method to trigger the request. */ deleteFn: (id: string) => new OpenApiRequestBuilder>( 'delete', - "test/{id}", + "/test/{id}", { pathParameters: { id } } @@ -234,7 +234,7 @@ describe('serializeOperation', () => { additionalProperties: { type: 'any' }, properties: [] }, - pathPattern: "test('{id}')" + pathPattern: "/test('{id}')" }; expect(serializeOperation(operation)).toMatchSnapshot(); @@ -276,19 +276,19 @@ describe('serializeOperation', () => { ], responses: { 200: { description: 'some response description' } }, response: { type: 'any' }, - pathPattern: 'test' + pathPattern: '/test' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of get requests to the 'test' endpoint. + * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit, page. * @param headerParameters - Object containing the following keys: resource-group. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (queryParameters: {'limit'?: number, 'page'?: number}, headerParameters: {'resource-group': string}) => new OpenApiRequestBuilder( 'get', - "test", + "/test", { queryParameters, headerParameters @@ -341,19 +341,19 @@ describe('serializeOperation', () => { ], responses: { 200: { description: 'some response description' } }, response: { type: 'any' }, - pathPattern: 'test' + pathPattern: '/test' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of get requests to the 'test' endpoint. + * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit, page. * @param headerParameters - Object containing the following keys: authentication, resource-group. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (queryParameters: {'limit'?: number, 'page'?: number}, headerParameters: {'authentication': string, 'resource-group'?: string}) => new OpenApiRequestBuilder( 'get', - "test", + "/test", { queryParameters, headerParameters @@ -390,19 +390,19 @@ describe('serializeOperation', () => { ], responses: { 200: { description: 'some response description' } }, response: { type: 'any' }, - pathPattern: 'test' + pathPattern: '/test' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of get requests to the 'test' endpoint. + * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit. * @param headerParameters - Object containing the following keys: resource-group. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (queryParameters: {'limit': number}, headerParameters?: {'resource-group'?: string}) => new OpenApiRequestBuilder( 'get', - "test", + "/test", { queryParameters, headerParameters @@ -447,19 +447,19 @@ describe('serializeOperation', () => { ], responses: { 200: { description: 'some response description' } }, response: { type: 'any' }, - pathPattern: 'test' + pathPattern: '/test' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of get requests to the 'test' endpoint. + * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit, page. * @param headerParameters - Object containing the following keys: resource-group. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (queryParameters: {'limit': number, 'page'?: number}, headerParameters: {'resource-group': string}) => new OpenApiRequestBuilder( 'get', - "test", + "/test", { queryParameters, headerParameters @@ -486,18 +486,18 @@ describe('serializeOperation', () => { headerParameters: [], responses: { 200: { description: 'some response description' } }, response: { type: 'any' }, - pathPattern: 'test' + pathPattern: '/test' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of get requests to the 'test' endpoint. + * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (queryParameters?: {'limit'?: number}) => new OpenApiRequestBuilder( 'get', - "test", + "/test", { queryParameters } @@ -531,18 +531,18 @@ describe('serializeOperation', () => { }, responses: { 200: { description: 'some response description' } }, response: { type: 'any' }, - pathPattern: 'test/{id}' + pathPattern: '/test/{id}' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of post requests to the 'test/{id}' endpoint. + * Create a request builder for execution of post requests to the '/test/{id}' endpoint. * @param id - Path parameter. * @param body - Request body. * @returns The request builder, use the \`execute()\` method to trigger the request. */ createFn: (id: string, body: Record) => new OpenApiRequestBuilder( 'post', - "test/{id}", + "/test/{id}", { pathParameters: { id }, body @@ -568,18 +568,18 @@ describe('serializeOperation', () => { } as OpenApiReferenceSchema }, response: { type: 'string' }, - pathPattern: 'test' + pathPattern: '/test' }; expect(serializeOperation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of post requests to the 'test' endpoint. + * Create a request builder for execution of post requests to the '/test' endpoint. * @param body - Request body. * @returns The request builder, use the \`execute()\` method to trigger the request. */ fnWithRefBody: (body: RefType | undefined) => new OpenApiRequestBuilder( 'post', - "test", + "/test", { body } @@ -591,7 +591,7 @@ describe('serializeOperation', () => { return { response: { type: 'string' }, method: 'GET', - pathPattern: 'my/Api', + pathPattern: '/my/Api', pathParameters: [] as OpenApiParameter[], queryParameters: [] as OpenApiParameter[] } as OpenApiOperation; @@ -601,7 +601,7 @@ describe('serializeOperation', () => { const operation = getOperation(); expect(operationDocumentation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of GET requests to the 'my/Api' endpoint. + * Create a request builder for execution of GET requests to the '/my/Api' endpoint. * @returns The request builder, use the \`execute()\` method to trigger the request. */" `); @@ -623,7 +623,7 @@ describe('serializeOperation', () => { ] as OpenApiParameter[]; expect(operationDocumentation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of GET requests to the 'my/Api' endpoint. + * Create a request builder for execution of GET requests to the '/my/Api' endpoint. * @param pathParameter1 - Path parameter. * @param path-parameter-2 - Path parameter. * @returns The request builder, use the \`execute()\` method to trigger the request. @@ -655,7 +655,7 @@ describe('serializeOperation', () => { ] as OpenApiParameter[]; expect(operationDocumentation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of GET requests to the 'my/Api' endpoint. + * Create a request builder for execution of GET requests to the '/my/Api' endpoint. * @param queryParameters - Object containing the following keys: queryParameter1, queryParameter2. * @param headerParameters - Object containing the following keys: headerParameter1. * @returns The request builder, use the \`execute()\` method to trigger the request. @@ -668,7 +668,7 @@ describe('serializeOperation', () => { operation.requestBody = { schema: { type: 'string' }, required: true }; expect(operationDocumentation(operation)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of GET requests to the 'my/Api' endpoint. + * Create a request builder for execution of GET requests to the '/my/Api' endpoint. * @param body - Request body. * @returns The request builder, use the \`execute()\` method to trigger the request. */" diff --git a/packages/openapi-generator/src/file-serializer/operation.ts b/packages/openapi-generator/src/file-serializer/operation.ts index 025d69bef9..620b3d8d37 100644 --- a/packages/openapi-generator/src/file-serializer/operation.ts +++ b/packages/openapi-generator/src/file-serializer/operation.ts @@ -9,7 +9,7 @@ import type { /** * Serialize an operation to a string. * @param operation - Operation to serialize. - * @param santisedBasePath - Sanitised base path(leading slashes removed and only contains one trailing slash) from optionsPerService that gets prefixed to the operation path pattern. + * @param santisedBasePath - Sanitised base path(one leading slash and all trailing slashes removed) from optionsPerService that gets prefixed to the operation path pattern. * @returns The operation as a string. * @internal */ @@ -33,7 +33,7 @@ export function serializeOperation( const responseType = serializeSchema(operation.response); return codeBlock` -${operationDocumentation(operation)} +${operationDocumentation(operation, pathPatternWithBasePath)} ${operation.operationId}: (${serializeOperationSignature( operation )}) => new OpenApiRequestBuilder<${responseType}>( @@ -139,7 +139,10 @@ function serializeParamsForRequestBuilder( /** * @internal */ -export function operationDocumentation(operation: OpenApiOperation): string { +export function operationDocumentation( + operation: OpenApiOperation, + pathPatternWithBasePath?: string +): string { const signature: string[] = []; if (operation.pathParameters.length) { signature.push(...getSignatureOfPathParameters(operation.pathParameters)); @@ -164,7 +167,10 @@ export function operationDocumentation(operation: OpenApiOperation): string { signature.push( '@returns The request builder, use the `execute()` method to trigger the request.' ); - const lines = [getOperationDescriptionText(operation), ...signature]; + const lines = [ + getOperationDescriptionText(operation, pathPatternWithBasePath), + ...signature + ]; return documentationBlock`${lines.join(unixEOL)}`; } @@ -181,10 +187,13 @@ function getSignatureOfBody(body: OpenApiRequestBody): string { return `@param body - ${body.description || 'Request body.'}`; } -function getOperationDescriptionText(operation: OpenApiOperation): string { +function getOperationDescriptionText( + operation: OpenApiOperation, + pathPatternWithBasePath?: string +): string { if (operation.description) { return operation.description; } - return `Create a request builder for execution of ${operation.method} requests to the '${operation.pathPattern}' endpoint.`; + return `Create a request builder for execution of ${operation.method} requests to the '${pathPatternWithBasePath || operation.pathPattern}' endpoint.`; } diff --git a/test-packages/test-services-openapi/generate-openapi-services.ts b/test-packages/test-services-openapi/generate-openapi-services.ts index 011beedbfc..7fa0cadb98 100644 --- a/test-packages/test-services-openapi/generate-openapi-services.ts +++ b/test-packages/test-services-openapi/generate-openapi-services.ts @@ -16,13 +16,30 @@ const generatorConfigOpenApi: Partial = { async function generateOpenApi() { await generate({ ...generatorConfigOpenApi, - input: resolve('..', '..', 'test-resources', 'openapi-service-specs'), + input: resolve( + '..', + '..', + 'test-resources', + 'openapi-service-specs', + 'test-service.json' + ), outputDir: resolve('.'), - transpile: true + transpile: true, + optionsPerService: resolve( + '..', + '..', + 'test-resources', + 'openapi-service-specs', + 'options-per-service.json' + ) }).catch(reason => { logger.error(`Unhandled rejection at: ${reason}`); process.exit(1); }); } -generateOpenApi(); +try { + generateOpenApi(); +} catch (error) { + console.log(error); +} diff --git a/test-packages/test-services-openapi/test-service/default-api.d.ts b/test-packages/test-services-openapi/test-service/default-api.d.ts index 784e6d8cb7..d3358f4385 100644 --- a/test-packages/test-services-openapi/test-service/default-api.d.ts +++ b/test-packages/test-services-openapi/test-service/default-api.d.ts @@ -10,12 +10,12 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export declare const DefaultApi: { /** - * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ noTag: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ defaultTag: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/default-api.js b/test-packages/test-services-openapi/test-service/default-api.js index f4d7db5eb4..9a77a9a9c6 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js +++ b/test-packages/test-services-openapi/test-service/default-api.js @@ -13,14 +13,14 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.DefaultApi = { /** - * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - noTag: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/default-tag'), + noTag: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/default-tag'), /** - * Create a request builder for execution of post requests to the '/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - defaultTag: () => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/default-tag') + defaultTag: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/default-tag') }; //# sourceMappingURL=default-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/default-api.js.map b/test-packages/test-services-openapi/test-service/default-api.js.map index 23e9cf5676..dc1045121c 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js.map +++ b/test-packages/test-services-openapi/test-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB;;;OAGG;IACH,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,+BAAqB,CAAM,KAAK,EAAE,yBAAyB,CAAC;IAC7E;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CAAM,MAAM,EAAE,yBAAyB,CAAC;CACpE,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB;;;OAGG;IACH,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,+BAAqB,CACvB,KAAK,EACL,8CAA8C,CAC/C;IACH;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,MAAM,EACN,8CAA8C,CAC/C;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/default-api.ts b/test-packages/test-services-openapi/test-service/default-api.ts index 56b9dd460f..14c7d3e0ee 100644 --- a/test-packages/test-services-openapi/test-service/default-api.ts +++ b/test-packages/test-services-openapi/test-service/default-api.ts @@ -10,14 +10,21 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export const DefaultApi = { /** - * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - noTag: () => new OpenApiRequestBuilder('get', '/test-cases/default-tag'), + noTag: () => + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/test-cases/default-tag' + ), /** - * Create a request builder for execution of post requests to the '/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ defaultTag: () => - new OpenApiRequestBuilder('post', '/test-cases/default-tag') + new OpenApiRequestBuilder( + 'post', + '/base/path/to/service/test-cases/default-tag' + ) }; diff --git a/test-packages/test-services-openapi/test-service/entity-api.d.ts b/test-packages/test-services-openapi/test-service/entity-api.d.ts index ceb020a451..4948ce1542 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.d.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.d.ts @@ -26,7 +26,7 @@ export declare const EntityApi: { enumBooleanParameter?: true | false; }) => OpenApiRequestBuilder; /** - * Create a request builder for execution of put requests to the '/entities' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -40,7 +40,7 @@ export declare const EntityApi: { */ createEntity: (body: TestEntity | undefined) => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/entities' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -48,7 +48,7 @@ export declare const EntityApi: { body: Record | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of delete requests to the '/entities' endpoint. + * Create a request builder for execution of delete requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ diff --git a/test-packages/test-services-openapi/test-service/entity-api.js b/test-packages/test-services-openapi/test-service/entity-api.js index a07294ad18..38436e7b99 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js +++ b/test-packages/test-services-openapi/test-service/entity-api.js @@ -17,15 +17,15 @@ exports.EntityApi = { * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. * @returns The request builder, use the `execute()` method to trigger the request. */ - getAllEntities: (queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/entities', { + getAllEntities: (queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/entities', { queryParameters }), /** - * Create a request builder for execution of put requests to the '/entities' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - updateEntityWithPut: (body) => new openapi_1.OpenApiRequestBuilder('put', '/entities', { + updateEntityWithPut: (body) => new openapi_1.OpenApiRequestBuilder('put', '/base/path/to/service/entities', { body }), /** @@ -33,42 +33,42 @@ exports.EntityApi = { * @param body - Entity to create * @returns The request builder, use the `execute()` method to trigger the request. */ - createEntity: (body) => new openapi_1.OpenApiRequestBuilder('post', '/entities', { + createEntity: (body) => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/entities', { body }), /** - * Create a request builder for execution of patch requests to the '/entities' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - updateEntity: (body) => new openapi_1.OpenApiRequestBuilder('patch', '/entities', { + updateEntity: (body) => new openapi_1.OpenApiRequestBuilder('patch', '/base/path/to/service/entities', { body }), /** - * Create a request builder for execution of delete requests to the '/entities' endpoint. + * Create a request builder for execution of delete requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - deleteEntity: (body) => new openapi_1.OpenApiRequestBuilder('delete', '/entities', { + deleteEntity: (body) => new openapi_1.OpenApiRequestBuilder('delete', '/base/path/to/service/entities', { body }), /** * Head request of entities * @returns The request builder, use the `execute()` method to trigger the request. */ - headEntities: () => new openapi_1.OpenApiRequestBuilder('head', '/entities'), + headEntities: () => new openapi_1.OpenApiRequestBuilder('head', '/base/path/to/service/entities'), /** * Get entity by id * @param entityId - Key property of the entity * @returns The request builder, use the `execute()` method to trigger the request. */ - getEntityByKey: (entityId) => new openapi_1.OpenApiRequestBuilder('get', '/entities/{entityId}', { + getEntityByKey: (entityId) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/entities/{entityId}', { pathParameters: { entityId } }), /** * Count entities * @returns The request builder, use the `execute()` method to trigger the request. */ - countEntities: () => new openapi_1.OpenApiRequestBuilder('get', '/entities/count') + countEntities: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/entities/count') }; //# sourceMappingURL=entity-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/entity-api.js.map b/test-packages/test-services-openapi/test-service/entity-api.js.map index 57122bb502..f80589a5a5 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js.map +++ b/test-packages/test-services-openapi/test-service/entity-api.js.map @@ -1 +1 @@ -{"version":3,"file":"entity-api.js","sourceRoot":"","sources":["entity-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB;;;;OAIG;IACH,cAAc,EAAE,CAAC,eAShB,EAAE,EAAE,CACH,IAAI,+BAAqB,CAAe,KAAK,EAAE,WAAW,EAAE;QAC1D,eAAe;KAChB,CAAC;IACJ;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACtD,IAAI,+BAAqB,CAAM,KAAK,EAAE,WAAW,EAAE;QACjD,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC7C,IAAI,+BAAqB,CAAM,MAAM,EAAE,WAAW,EAAE;QAClD,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAqC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CAAM,OAAO,EAAE,WAAW,EAAE;QACnD,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA0B,EAAE,EAAE,CAC3C,IAAI,+BAAqB,CAAM,QAAQ,EAAE,WAAW,EAAE;QACpD,IAAI;KACL,CAAC;IACJ;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,+BAAqB,CAAM,MAAM,EAAE,WAAW,CAAC;IACvE;;;;OAIG;IACH,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CACnC,IAAI,+BAAqB,CAAM,KAAK,EAAE,sBAAsB,EAAE;QAC5D,cAAc,EAAE,EAAE,QAAQ,EAAE;KAC7B,CAAC;IACJ;;;OAGG;IACH,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,+BAAqB,CAAS,KAAK,EAAE,iBAAiB,CAAC;CAC9D,CAAC"} \ No newline at end of file +{"version":3,"file":"entity-api.js","sourceRoot":"","sources":["entity-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB;;;;OAIG;IACH,cAAc,EAAE,CAAC,eAShB,EAAE,EAAE,CACH,IAAI,+BAAqB,CACvB,KAAK,EACL,gCAAgC,EAChC;QACE,eAAe;KAChB,CACF;IACH;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACtD,IAAI,+BAAqB,CAAM,KAAK,EAAE,gCAAgC,EAAE;QACtE,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC7C,IAAI,+BAAqB,CAAM,MAAM,EAAE,gCAAgC,EAAE;QACvE,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAqC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CAAM,OAAO,EAAE,gCAAgC,EAAE;QACxE,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA0B,EAAE,EAAE,CAC3C,IAAI,+BAAqB,CAAM,QAAQ,EAAE,gCAAgC,EAAE;QACzE,IAAI;KACL,CAAC;IACJ;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CAAM,MAAM,EAAE,gCAAgC,CAAC;IAC1E;;;;OAIG;IACH,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CACnC,IAAI,+BAAqB,CACvB,KAAK,EACL,2CAA2C,EAC3C;QACE,cAAc,EAAE,EAAE,QAAQ,EAAE;KAC7B,CACF;IACH;;;OAGG;IACH,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,+BAAqB,CACvB,KAAK,EACL,sCAAsC,CACvC;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/entity-api.ts b/test-packages/test-services-openapi/test-service/entity-api.ts index abdaf0a6ba..8e6f01fe9e 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.ts @@ -25,16 +25,20 @@ export const EntityApi = { enumDoubleParameter?: 1 | 2; enumBooleanParameter?: true | false; }) => - new OpenApiRequestBuilder('get', '/entities', { - queryParameters - }), + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/entities', + { + queryParameters + } + ), /** - * Create a request builder for execution of put requests to the '/entities' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ updateEntityWithPut: (body: TestEntity[] | undefined) => - new OpenApiRequestBuilder('put', '/entities', { + new OpenApiRequestBuilder('put', '/base/path/to/service/entities', { body }), /** @@ -43,45 +47,53 @@ export const EntityApi = { * @returns The request builder, use the `execute()` method to trigger the request. */ createEntity: (body: TestEntity | undefined) => - new OpenApiRequestBuilder('post', '/entities', { + new OpenApiRequestBuilder('post', '/base/path/to/service/entities', { body }), /** - * Create a request builder for execution of patch requests to the '/entities' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ updateEntity: (body: Record | undefined) => - new OpenApiRequestBuilder('patch', '/entities', { + new OpenApiRequestBuilder('patch', '/base/path/to/service/entities', { body }), /** - * Create a request builder for execution of delete requests to the '/entities' endpoint. + * Create a request builder for execution of delete requests to the '/base/path/to/service/entities||/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ deleteEntity: (body: string[] | undefined) => - new OpenApiRequestBuilder('delete', '/entities', { + new OpenApiRequestBuilder('delete', '/base/path/to/service/entities', { body }), /** * Head request of entities * @returns The request builder, use the `execute()` method to trigger the request. */ - headEntities: () => new OpenApiRequestBuilder('head', '/entities'), + headEntities: () => + new OpenApiRequestBuilder('head', '/base/path/to/service/entities'), /** * Get entity by id * @param entityId - Key property of the entity * @returns The request builder, use the `execute()` method to trigger the request. */ getEntityByKey: (entityId: string) => - new OpenApiRequestBuilder('get', '/entities/{entityId}', { - pathParameters: { entityId } - }), + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/entities/{entityId}', + { + pathParameters: { entityId } + } + ), /** * Count entities * @returns The request builder, use the `execute()` method to trigger the request. */ countEntities: () => - new OpenApiRequestBuilder('get', '/entities/count') + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/entities/count' + ) }; diff --git a/test-packages/test-services-openapi/test-service/extension-api.d.ts b/test-packages/test-services-openapi/test-service/extension-api.d.ts index 189d9fb662..82e021c744 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.d.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.d.ts @@ -10,12 +10,12 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export declare const ExtensionApi: { /** - * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ niceGetFunction: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ nicePostFunction: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/extension-api.js b/test-packages/test-services-openapi/test-service/extension-api.js index 508710af99..f79c49dc7f 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js +++ b/test-packages/test-services-openapi/test-service/extension-api.js @@ -13,14 +13,14 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.ExtensionApi = { /** - * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - niceGetFunction: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/extension'), + niceGetFunction: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/extension'), /** - * Create a request builder for execution of post requests to the '/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - nicePostFunction: () => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/extension') + nicePostFunction: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/extension') }; //# sourceMappingURL=extension-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/extension-api.js.map b/test-packages/test-services-openapi/test-service/extension-api.js.map index 9617f956fa..3d14f73d16 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js.map +++ b/test-packages/test-services-openapi/test-service/extension-api.js.map @@ -1 +1 @@ -{"version":3,"file":"extension-api.js","sourceRoot":"","sources":["extension-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE,CACpB,IAAI,+BAAqB,CAAM,KAAK,EAAE,uBAAuB,CAAC;IAChE;;;OAGG;IACH,gBAAgB,EAAE,GAAG,EAAE,CACrB,IAAI,+BAAqB,CAAM,MAAM,EAAE,uBAAuB,CAAC;CAClE,CAAC"} \ No newline at end of file +{"version":3,"file":"extension-api.js","sourceRoot":"","sources":["extension-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE,CACpB,IAAI,+BAAqB,CACvB,KAAK,EACL,4CAA4C,CAC7C;IACH;;;OAGG;IACH,gBAAgB,EAAE,GAAG,EAAE,CACrB,IAAI,+BAAqB,CACvB,MAAM,EACN,4CAA4C,CAC7C;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/extension-api.ts b/test-packages/test-services-openapi/test-service/extension-api.ts index 9d961f2748..7dacaa6204 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.ts @@ -10,15 +10,21 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export const ExtensionApi = { /** - * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ niceGetFunction: () => - new OpenApiRequestBuilder('get', '/test-cases/extension'), + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/test-cases/extension' + ), /** - * Create a request builder for execution of post requests to the '/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ nicePostFunction: () => - new OpenApiRequestBuilder('post', '/test-cases/extension') + new OpenApiRequestBuilder( + 'post', + '/base/path/to/service/test-cases/extension' + ) }; diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts index e69deb0479..f81f7a554e 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts @@ -10,7 +10,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export declare const TagDotApi: { /** - * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithDot: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js b/test-packages/test-services-openapi/test-service/tag-dot-api.js index fc10db4b37..cd2ccd63de 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js @@ -13,9 +13,9 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.TagDotApi = { /** - * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - tagWithDot: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/special-tag') + tagWithDot: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/special-tag') }; //# sourceMappingURL=tag-dot-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js.map b/test-packages/test-services-openapi/test-service/tag-dot-api.js.map index d22d161208..2f3b6453a8 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js.map +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js.map @@ -1 +1 @@ -{"version":3,"file":"tag-dot-api.js","sourceRoot":"","sources":["tag-dot-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CAAM,KAAK,EAAE,yBAAyB,CAAC;CACnE,CAAC"} \ No newline at end of file +{"version":3,"file":"tag-dot-api.js","sourceRoot":"","sources":["tag-dot-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,KAAK,EACL,8CAA8C,CAC/C;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.ts index 727f30617c..3c1ca1a510 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.ts @@ -10,9 +10,12 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export const TagDotApi = { /** - * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithDot: () => - new OpenApiRequestBuilder('get', '/test-cases/special-tag') + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/test-cases/special-tag' + ) }; diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.d.ts b/test-packages/test-services-openapi/test-service/tag-space-api.d.ts index 463f81a71a..caa4d8e54c 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.d.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.d.ts @@ -10,7 +10,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export declare const TagSpaceApi: { /** - * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithSpace: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js b/test-packages/test-services-openapi/test-service/tag-space-api.js index 4718dd23c7..5273ad2054 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js @@ -13,9 +13,9 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.TagSpaceApi = { /** - * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - tagWithSpace: () => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/special-tag') + tagWithSpace: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/special-tag') }; //# sourceMappingURL=tag-space-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js.map b/test-packages/test-services-openapi/test-service/tag-space-api.js.map index a96ed3715b..643e307ef3 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js.map +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js.map @@ -1 +1 @@ -{"version":3,"file":"tag-space-api.js","sourceRoot":"","sources":["tag-space-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CAAM,MAAM,EAAE,yBAAyB,CAAC;CACpE,CAAC"} \ No newline at end of file +{"version":3,"file":"tag-space-api.js","sourceRoot":"","sources":["tag-space-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,8CAA8C,CAC/C;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.ts b/test-packages/test-services-openapi/test-service/tag-space-api.ts index 0fcc329b1e..d8e0c532ad 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.ts @@ -10,9 +10,12 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export const TagSpaceApi = { /** - * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithSpace: () => - new OpenApiRequestBuilder('post', '/test-cases/special-tag') + new OpenApiRequestBuilder( + 'post', + '/base/path/to/service/test-cases/special-tag' + ) }; diff --git a/test-packages/test-services-openapi/test-service/test-case-api.d.ts b/test-packages/test-services-openapi/test-service/test-case-api.d.ts index 3de9d4871d..5302f78dbb 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.d.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.d.ts @@ -16,7 +16,7 @@ import type { */ export declare const TestCaseApi: { /** - * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. @@ -33,7 +33,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. @@ -50,7 +50,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -64,7 +64,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. @@ -80,7 +80,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. @@ -96,7 +96,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}||/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -108,27 +108,27 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of put requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1_1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId_1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}||/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. @@ -140,7 +140,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -148,7 +148,7 @@ export declare const TestCaseApi: { body: ComplexTestEntity | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -156,7 +156,7 @@ export declare const TestCaseApi: { body: SimpleTestEntityWITHSymbols | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer||/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -164,7 +164,7 @@ export declare const TestCaseApi: { body: Schema123456 | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id||/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ getTestCasesNoOperationId: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js b/test-packages/test-services-openapi/test-service/test-case-api.js index cc5f82816d..7f707558fa 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js +++ b/test-packages/test-services-openapi/test-service/test-case-api.js @@ -13,131 +13,131 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.TestCaseApi = { /** - * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseGetRequiredParameters: (requiredPathItemPathParam, body, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { + testCaseGetRequiredParameters: (requiredPathItemPathParam, body, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { pathParameters: { requiredPathItemPathParam }, body, queryParameters }), /** - * Create a request builder for execution of post requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCasePostRequiredParameters: (requiredPathItemPathParam, body, queryParameters) => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { + testCasePostRequiredParameters: (requiredPathItemPathParam, body, queryParameters) => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { pathParameters: { requiredPathItemPathParam }, body, queryParameters }), /** - * Create a request builder for execution of get requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseRequiredQueryOptionalHeader: (queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/parameters', { + testCaseRequiredQueryOptionalHeader: (queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/parameters', { queryParameters, headerParameters }), /** - * Create a request builder for execution of post requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseOptionalQueryRequiredHeader: (body, queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/parameters', { + testCaseOptionalQueryRequiredHeader: (body, queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/parameters', { body, queryParameters, headerParameters }), /** - * Create a request builder for execution of patch requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseOptionalQueryOptionalHeader: (body, queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('patch', '/test-cases/parameters', { + testCaseOptionalQueryOptionalHeader: (body, queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('patch', '/base/path/to/service/test-cases/parameters', { body, queryParameters, headerParameters }), /** - * Create a request builder for execution of get requests to the '/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}||/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseGetDuplicateParameters: (duplicateParam, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/parameters/{duplicateParam}', { + testCaseGetDuplicateParameters: (duplicateParam, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/parameters/{duplicateParam}', { pathParameters: { duplicateParam }, queryParameters }), /** - * Create a request builder for execution of get requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - duplicateOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/duplicate-operation-ids'), + duplicateOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/duplicate-operation-ids'), /** - * Create a request builder for execution of put requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - duplicateOperationId1_1: () => new openapi_1.OpenApiRequestBuilder('put', '/test-cases/duplicate-operation-ids'), + duplicateOperationId1_1: () => new openapi_1.OpenApiRequestBuilder('put', '/base/path/to/service/test-cases/duplicate-operation-ids'), /** - * Create a request builder for execution of post requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - duplicateOperationId_1: () => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/duplicate-operation-ids'), + duplicateOperationId_1: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/duplicate-operation-ids'), /** - * Create a request builder for execution of patch requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - duplicateOperationId1: () => new openapi_1.OpenApiRequestBuilder('patch', '/test-cases/duplicate-operation-ids'), + duplicateOperationId1: () => new openapi_1.OpenApiRequestBuilder('patch', '/base/path/to/service/test-cases/duplicate-operation-ids'), /** - * Create a request builder for execution of get requests to the '/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}||/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. */ - export: (const1, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/reserved-keywords/{const1}', { + export: (const1, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/reserved-keywords/{const1}', { pathParameters: { const1 }, queryParameters }), /** - * Create a request builder for execution of get requests to the '/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - complexSchemas: (body) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/complex-schemas', { + complexSchemas: (body) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/complex-schemas', { body }), /** - * Create a request builder for execution of post requests to the '/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - useNameWithSymbols: (body) => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/complex-schemas', { + useNameWithSymbols: (body) => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/complex-schemas', { body }), /** - * Create a request builder for execution of get requests to the '/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer||/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - schemaNameInteger: (body) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/schema-name-integer', { + schemaNameInteger: (body) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/schema-name-integer', { body }), /** - * Create a request builder for execution of get requests to the '/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id||/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - getTestCasesNoOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/no-operation-id') + getTestCasesNoOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/no-operation-id') }; //# sourceMappingURL=test-case-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js.map b/test-packages/test-services-openapi/test-service/test-case-api.js.map index f1765e319e..a7e8e7f6f1 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js.map +++ b/test-packages/test-services-openapi/test-service/test-case-api.js.map @@ -1 +1 @@ -{"version":3,"file":"test-case-api.js","sourceRoot":"","sources":["test-case-api.ts"],"names":[],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"test-case-api.js","sourceRoot":"","sources":["test-case-api.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/test-case-api.ts b/test-packages/test-services-openapi/test-service/test-case-api.ts index 767a389d91..a79063e6b8 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.ts @@ -16,7 +16,7 @@ import type { */ export const TestCaseApi = { /** - * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. @@ -34,7 +34,7 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'get', - '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', + '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { pathParameters: { requiredPathItemPathParam }, body, @@ -42,7 +42,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of post requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. @@ -60,7 +60,7 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'post', - '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', + '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { pathParameters: { requiredPathItemPathParam }, body, @@ -68,7 +68,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of get requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -77,12 +77,16 @@ export const TestCaseApi = { queryParameters: { requiredQueryParam: string }, headerParameters?: { optionalHeaderParam?: string } ) => - new OpenApiRequestBuilder('get', '/test-cases/parameters', { - queryParameters, - headerParameters - }), + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/test-cases/parameters', + { + queryParameters, + headerParameters + } + ), /** - * Create a request builder for execution of post requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. @@ -93,13 +97,17 @@ export const TestCaseApi = { queryParameters: { optionalQueryParam?: string }, headerParameters: { requiredHeaderParam: string } ) => - new OpenApiRequestBuilder('post', '/test-cases/parameters', { - body, - queryParameters, - headerParameters - }), + new OpenApiRequestBuilder( + 'post', + '/base/path/to/service/test-cases/parameters', + { + body, + queryParameters, + headerParameters + } + ), /** - * Create a request builder for execution of patch requests to the '/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. @@ -110,13 +118,17 @@ export const TestCaseApi = { queryParameters?: { optionalQueryParam?: string }, headerParameters?: { optionalHeaderParam?: string } ) => - new OpenApiRequestBuilder('patch', '/test-cases/parameters', { - body, - queryParameters, - headerParameters - }), + new OpenApiRequestBuilder( + 'patch', + '/base/path/to/service/test-cases/parameters', + { + body, + queryParameters, + headerParameters + } + ), /** - * Create a request builder for execution of get requests to the '/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}||/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -127,50 +139,50 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'get', - '/test-cases/parameters/{duplicateParam}', + '/base/path/to/service/test-cases/parameters/{duplicateParam}', { pathParameters: { duplicateParam }, queryParameters } ), /** - * Create a request builder for execution of get requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId: () => new OpenApiRequestBuilder( 'get', - '/test-cases/duplicate-operation-ids' + '/base/path/to/service/test-cases/duplicate-operation-ids' ), /** - * Create a request builder for execution of put requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1_1: () => new OpenApiRequestBuilder( 'put', - '/test-cases/duplicate-operation-ids' + '/base/path/to/service/test-cases/duplicate-operation-ids' ), /** - * Create a request builder for execution of post requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId_1: () => new OpenApiRequestBuilder( 'post', - '/test-cases/duplicate-operation-ids' + '/base/path/to/service/test-cases/duplicate-operation-ids' ), /** - * Create a request builder for execution of patch requests to the '/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1: () => new OpenApiRequestBuilder( 'patch', - '/test-cases/duplicate-operation-ids' + '/base/path/to/service/test-cases/duplicate-operation-ids' ), /** - * Create a request builder for execution of get requests to the '/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}||/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. @@ -178,43 +190,58 @@ export const TestCaseApi = { export: (const1: string, queryParameters: { const: string }) => new OpenApiRequestBuilder( 'get', - '/test-cases/reserved-keywords/{const1}', + '/base/path/to/service/test-cases/reserved-keywords/{const1}', { pathParameters: { const1 }, queryParameters } ), /** - * Create a request builder for execution of get requests to the '/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ complexSchemas: (body: ComplexTestEntity | undefined) => - new OpenApiRequestBuilder('get', '/test-cases/complex-schemas', { - body - }), + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/test-cases/complex-schemas', + { + body + } + ), /** - * Create a request builder for execution of post requests to the '/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ useNameWithSymbols: (body: SimpleTestEntityWITHSymbols | undefined) => - new OpenApiRequestBuilder('post', '/test-cases/complex-schemas', { - body - }), + new OpenApiRequestBuilder( + 'post', + '/base/path/to/service/test-cases/complex-schemas', + { + body + } + ), /** - * Create a request builder for execution of get requests to the '/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer||/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ schemaNameInteger: (body: Schema123456 | undefined) => - new OpenApiRequestBuilder('get', '/test-cases/schema-name-integer', { - body - }), + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/test-cases/schema-name-integer', + { + body + } + ), /** - * Create a request builder for execution of get requests to the '/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id||/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ getTestCasesNoOperationId: () => - new OpenApiRequestBuilder('get', '/test-cases/no-operation-id') + new OpenApiRequestBuilder( + 'get', + '/base/path/to/service/test-cases/no-operation-id' + ) }; diff --git a/test-resources/openapi-service-specs/options-per-service.json b/test-resources/openapi-service-specs/options-per-service.json new file mode 100644 index 0000000000..7aa214b4bf --- /dev/null +++ b/test-resources/openapi-service-specs/options-per-service.json @@ -0,0 +1,7 @@ +{ + "../../test-resources/openapi-service-specs/test-service.json": { + "packageName": "test-service", + "directoryName": "test-service", + "basePath": "/base/path/to/service" + } +} From 84a7af831b97069416476c8bcc17fab124ad6f72 Mon Sep 17 00:00:00 2001 From: i341658 Date: Wed, 4 Dec 2024 09:50:10 +0100 Subject: [PATCH 08/59] chore: fix codeQL warning --- packages/util/src/remove-slashes.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/util/src/remove-slashes.ts b/packages/util/src/remove-slashes.ts index 67ef8bcb1c..e2d391b6a6 100644 --- a/packages/util/src/remove-slashes.ts +++ b/packages/util/src/remove-slashes.ts @@ -11,12 +11,18 @@ export function removeSlashes(path: string): string { * @internal */ export function removeTrailingSlashes(path: string): string { - return path.replace(/\/+$/, ''); + while (path.endsWith('/')) { + path = path.endsWith('/') ? path.slice(0, -1) : path; + } + return path; } /** * @internal */ export function removeLeadingSlashes(path: string): string { - return path.replace(/^\/+/, ''); + while (path.startsWith('/')) { + path = path.startsWith('/') ? path.slice(1) : path; + } + return path; } From 43142a90ca4710271644b9edee7e41aef558d200 Mon Sep 17 00:00:00 2001 From: cloud-sdk-js Date: Wed, 4 Dec 2024 08:52:26 +0000 Subject: [PATCH 09/59] Changes from lint:fix --- .github/actions/check-public-api/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/check-public-api/index.js b/.github/actions/check-public-api/index.js index 28ea4c2444..3de0b32acd 100644 --- a/.github/actions/check-public-api/index.js +++ b/.github/actions/check-public-api/index.js @@ -74871,13 +74871,19 @@ function removeSlashes(path) { * @internal */ function removeTrailingSlashes(path) { - return path.replace(/\/+$/, ''); + while (path.endsWith('/')) { + path = path.endsWith('/') ? path.slice(0, -1) : path; + } + return path; } /** * @internal */ function removeLeadingSlashes(path) { - return path.replace(/^\/+/, ''); + while (path.startsWith('/')) { + path = path.startsWith('/') ? path.slice(1) : path; + } + return path; } //# sourceMappingURL=remove-slashes.js.map From e934945ac1ec40266a2c9daad2bee9883ef0334e Mon Sep 17 00:00:00 2001 From: i341658 Date: Wed, 4 Dec 2024 12:39:08 +0100 Subject: [PATCH 10/59] chore: add changeset --- .changeset/chilled-flowers-hide.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/chilled-flowers-hide.md diff --git a/.changeset/chilled-flowers-hide.md b/.changeset/chilled-flowers-hide.md new file mode 100644 index 0000000000..b43c4645ed --- /dev/null +++ b/.changeset/chilled-flowers-hide.md @@ -0,0 +1,6 @@ +--- +'@sap-cloud-sdk/openapi-generator': minor +'@sap-cloud-sdk/util': minor +--- + +[New Functionality] Support `basePath` in the `options-per-service.json` file in the OpenAPI generator. It enables the base path to be prepended to the path parameter for every request of the generated client. From 8e2dc85c88fa453d2d5500f15daefd0925f72d14 Mon Sep 17 00:00:00 2001 From: i341658 Date: Wed, 4 Dec 2024 13:08:19 +0100 Subject: [PATCH 11/59] chore: cleanup tests --- .../src/file-serializer/api-file.ts | 5 ++-- .../test-service/default-api.d.ts | 4 +-- .../test-service/default-api.js | 4 +-- .../test-service/default-api.ts | 4 +-- .../test-service/entity-api.d.ts | 6 ++-- .../test-service/entity-api.js | 6 ++-- .../test-service/entity-api.ts | 6 ++-- .../test-service/extension-api.d.ts | 4 +-- .../test-service/extension-api.js | 4 +-- .../test-service/extension-api.ts | 4 +-- .../test-service/tag-dot-api.d.ts | 2 +- .../test-service/tag-dot-api.js | 2 +- .../test-service/tag-dot-api.ts | 2 +- .../test-service/tag-space-api.d.ts | 2 +- .../test-service/tag-space-api.js | 2 +- .../test-service/tag-space-api.ts | 2 +- .../test-service/test-case-api.d.ts | 30 +++++++++---------- .../test-service/test-case-api.js | 30 +++++++++---------- .../test-service/test-case-api.ts | 30 +++++++++---------- 19 files changed, 75 insertions(+), 74 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index 8aa9e43476..67cacfbc21 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -34,10 +34,11 @@ export function apiFile( ): string { const imports = serializeImports(getImports(api, options)); const apiDoc = apiDocumentation(api, serviceName); - const santisiedBasePath = basePath ? '/' + removeSlashes(basePath) : ''; + const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; + const prefixedBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; const apiContent = codeBlock` export const ${api.name} = { - ${api.operations.map(operation => serializeOperation(operation, santisiedBasePath)).join(',\n')} + ${api.operations.map(operation => serializeOperation(operation, prefixedBasePath)).join(',\n')} }; `; diff --git a/test-packages/test-services-openapi/test-service/default-api.d.ts b/test-packages/test-services-openapi/test-service/default-api.d.ts index d3358f4385..d32908c218 100644 --- a/test-packages/test-services-openapi/test-service/default-api.d.ts +++ b/test-packages/test-services-openapi/test-service/default-api.d.ts @@ -10,12 +10,12 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export declare const DefaultApi: { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ noTag: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ defaultTag: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/default-api.js b/test-packages/test-services-openapi/test-service/default-api.js index 9a77a9a9c6..559361829d 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js +++ b/test-packages/test-services-openapi/test-service/default-api.js @@ -13,12 +13,12 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.DefaultApi = { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ noTag: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/default-tag'), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ defaultTag: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/default-tag') diff --git a/test-packages/test-services-openapi/test-service/default-api.ts b/test-packages/test-services-openapi/test-service/default-api.ts index 14c7d3e0ee..d6230f6bde 100644 --- a/test-packages/test-services-openapi/test-service/default-api.ts +++ b/test-packages/test-services-openapi/test-service/default-api.ts @@ -10,7 +10,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export const DefaultApi = { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ noTag: () => @@ -19,7 +19,7 @@ export const DefaultApi = { '/base/path/to/service/test-cases/default-tag' ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag||/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ defaultTag: () => diff --git a/test-packages/test-services-openapi/test-service/entity-api.d.ts b/test-packages/test-services-openapi/test-service/entity-api.d.ts index 4948ce1542..8ccc596d34 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.d.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.d.ts @@ -26,7 +26,7 @@ export declare const EntityApi: { enumBooleanParameter?: true | false; }) => OpenApiRequestBuilder; /** - * Create a request builder for execution of put requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -40,7 +40,7 @@ export declare const EntityApi: { */ createEntity: (body: TestEntity | undefined) => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -48,7 +48,7 @@ export declare const EntityApi: { body: Record | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of delete requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of delete requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ diff --git a/test-packages/test-services-openapi/test-service/entity-api.js b/test-packages/test-services-openapi/test-service/entity-api.js index 38436e7b99..66b78dcbb1 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js +++ b/test-packages/test-services-openapi/test-service/entity-api.js @@ -21,7 +21,7 @@ exports.EntityApi = { queryParameters }), /** - * Create a request builder for execution of put requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -37,7 +37,7 @@ exports.EntityApi = { body }), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -45,7 +45,7 @@ exports.EntityApi = { body }), /** - * Create a request builder for execution of delete requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of delete requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ diff --git a/test-packages/test-services-openapi/test-service/entity-api.ts b/test-packages/test-services-openapi/test-service/entity-api.ts index 8e6f01fe9e..769fee301a 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.ts @@ -33,7 +33,7 @@ export const EntityApi = { } ), /** - * Create a request builder for execution of put requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -51,7 +51,7 @@ export const EntityApi = { body }), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -60,7 +60,7 @@ export const EntityApi = { body }), /** - * Create a request builder for execution of delete requests to the '/base/path/to/service/entities||/entities' endpoint. + * Create a request builder for execution of delete requests to the '/base/path/to/service/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ diff --git a/test-packages/test-services-openapi/test-service/extension-api.d.ts b/test-packages/test-services-openapi/test-service/extension-api.d.ts index 82e021c744..0915d6c72c 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.d.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.d.ts @@ -10,12 +10,12 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export declare const ExtensionApi: { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ niceGetFunction: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ nicePostFunction: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/extension-api.js b/test-packages/test-services-openapi/test-service/extension-api.js index f79c49dc7f..6de79ed28d 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js +++ b/test-packages/test-services-openapi/test-service/extension-api.js @@ -13,12 +13,12 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.ExtensionApi = { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ niceGetFunction: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/extension'), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ nicePostFunction: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/extension') diff --git a/test-packages/test-services-openapi/test-service/extension-api.ts b/test-packages/test-services-openapi/test-service/extension-api.ts index 7dacaa6204..59dddbe16a 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.ts @@ -10,7 +10,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export const ExtensionApi = { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ niceGetFunction: () => @@ -19,7 +19,7 @@ export const ExtensionApi = { '/base/path/to/service/test-cases/extension' ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension||/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ nicePostFunction: () => diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts index f81f7a554e..631c376f58 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts @@ -10,7 +10,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export declare const TagDotApi: { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithDot: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js b/test-packages/test-services-openapi/test-service/tag-dot-api.js index cd2ccd63de..518041d39c 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js @@ -13,7 +13,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.TagDotApi = { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithDot: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/special-tag') diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.ts index 3c1ca1a510..d16720dabe 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.ts @@ -10,7 +10,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export const TagDotApi = { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithDot: () => diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.d.ts b/test-packages/test-services-openapi/test-service/tag-space-api.d.ts index caa4d8e54c..8a38b53069 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.d.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.d.ts @@ -10,7 +10,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export declare const TagSpaceApi: { /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithSpace: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js b/test-packages/test-services-openapi/test-service/tag-space-api.js index 5273ad2054..6e3f6505b2 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js @@ -13,7 +13,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.TagSpaceApi = { /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithSpace: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/special-tag') diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.ts b/test-packages/test-services-openapi/test-service/tag-space-api.ts index d8e0c532ad..b2acdd5c16 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.ts @@ -10,7 +10,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; */ export const TagSpaceApi = { /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag||/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithSpace: () => diff --git a/test-packages/test-services-openapi/test-service/test-case-api.d.ts b/test-packages/test-services-openapi/test-service/test-case-api.d.ts index 5302f78dbb..d4ba9b2502 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.d.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.d.ts @@ -16,7 +16,7 @@ import type { */ export declare const TestCaseApi: { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. @@ -33,7 +33,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. @@ -50,7 +50,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -64,7 +64,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. @@ -80,7 +80,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. @@ -96,7 +96,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}||/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -108,27 +108,27 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1_1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId_1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}||/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. @@ -140,7 +140,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -148,7 +148,7 @@ export declare const TestCaseApi: { body: ComplexTestEntity | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -156,7 +156,7 @@ export declare const TestCaseApi: { body: SimpleTestEntityWITHSymbols | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer||/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -164,7 +164,7 @@ export declare const TestCaseApi: { body: Schema123456 | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id||/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ getTestCasesNoOperationId: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js b/test-packages/test-services-openapi/test-service/test-case-api.js index 7f707558fa..b08048046d 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js +++ b/test-packages/test-services-openapi/test-service/test-case-api.js @@ -13,7 +13,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); */ exports.TestCaseApi = { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. @@ -25,7 +25,7 @@ exports.TestCaseApi = { queryParameters }), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. @@ -37,7 +37,7 @@ exports.TestCaseApi = { queryParameters }), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -47,7 +47,7 @@ exports.TestCaseApi = { headerParameters }), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. @@ -59,7 +59,7 @@ exports.TestCaseApi = { headerParameters }), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. @@ -71,7 +71,7 @@ exports.TestCaseApi = { headerParameters }), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}||/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -81,27 +81,27 @@ exports.TestCaseApi = { queryParameters }), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/duplicate-operation-ids'), /** - * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1_1: () => new openapi_1.OpenApiRequestBuilder('put', '/base/path/to/service/test-cases/duplicate-operation-ids'), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId_1: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/duplicate-operation-ids'), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1: () => new openapi_1.OpenApiRequestBuilder('patch', '/base/path/to/service/test-cases/duplicate-operation-ids'), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}||/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. @@ -111,7 +111,7 @@ exports.TestCaseApi = { queryParameters }), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -119,7 +119,7 @@ exports.TestCaseApi = { body }), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -127,7 +127,7 @@ exports.TestCaseApi = { body }), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer||/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -135,7 +135,7 @@ exports.TestCaseApi = { body }), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id||/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ getTestCasesNoOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/no-operation-id') diff --git a/test-packages/test-services-openapi/test-service/test-case-api.ts b/test-packages/test-services-openapi/test-service/test-case-api.ts index a79063e6b8..829ca84397 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.ts @@ -16,7 +16,7 @@ import type { */ export const TestCaseApi = { /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. @@ -42,7 +42,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}||/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. @@ -68,7 +68,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -86,7 +86,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. @@ -107,7 +107,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters||/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. @@ -128,7 +128,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}||/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -146,7 +146,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId: () => @@ -155,7 +155,7 @@ export const TestCaseApi = { '/base/path/to/service/test-cases/duplicate-operation-ids' ), /** - * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1_1: () => @@ -164,7 +164,7 @@ export const TestCaseApi = { '/base/path/to/service/test-cases/duplicate-operation-ids' ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId_1: () => @@ -173,7 +173,7 @@ export const TestCaseApi = { '/base/path/to/service/test-cases/duplicate-operation-ids' ), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids||/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1: () => @@ -182,7 +182,7 @@ export const TestCaseApi = { '/base/path/to/service/test-cases/duplicate-operation-ids' ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}||/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. @@ -197,7 +197,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -210,7 +210,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas||/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -223,7 +223,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer||/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -236,7 +236,7 @@ export const TestCaseApi = { } ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id||/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ getTestCasesNoOperationId: () => From 77737860cbe80a2ae96aa45530796c0f37b5e99b Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 6 Dec 2024 14:26:01 +0100 Subject: [PATCH 12/59] feat: extend openapi request builder for basePath --- packages/openapi/src/openapi-request-builder.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/openapi/src/openapi-request-builder.ts b/packages/openapi/src/openapi-request-builder.ts index 7d16063b43..ae296e7d19 100644 --- a/packages/openapi/src/openapi-request-builder.ts +++ b/packages/openapi/src/openapi-request-builder.ts @@ -39,11 +39,13 @@ export class OpenApiRequestBuilder { * @param method - HTTP method of the request to be built. * @param pathPattern - Path for the request containing path parameter references as in the OpenAPI specification. * @param parameters - Query parameters and or body to pass to the request. + * @param basePath - The path to be prefixed to the pathPattern. */ constructor( public method: Method, private pathPattern: string, - private parameters?: OpenApiRequestParameters + private parameters?: OpenApiRequestParameters, + private basePath?: string ) {} /** @@ -175,11 +177,14 @@ export class OpenApiRequestBuilder { // Get the innermost curly bracket pairs with non-empty and legal content as placeholders. const placeholders: string[] = this.pathPattern.match(/{[^/?#{}]+}/g) || []; - return placeholders.reduce((path: string, placeholder: string) => { - const strippedPlaceholder = placeholder.slice(1, -1); - const parameterValue = pathParameters[strippedPlaceholder]; - return path.replace(placeholder, encodeURIComponent(parameterValue)); - }, this.pathPattern); + return ( + (this.basePath ?? '') + + placeholders.reduce((path: string, placeholder: string) => { + const strippedPlaceholder = placeholder.slice(1, -1); + const parameterValue = pathParameters[strippedPlaceholder]; + return path.replace(placeholder, encodeURIComponent(parameterValue)); + }, this.pathPattern) + ); } } From cad73645c0b8eb427498e4f488a7c9a3d34d1a79 Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 6 Dec 2024 14:34:40 +0100 Subject: [PATCH 13/59] chore: introduce setBasePath --- packages/openapi/src/openapi-request-builder.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/openapi/src/openapi-request-builder.ts b/packages/openapi/src/openapi-request-builder.ts index ae296e7d19..0b3732727e 100644 --- a/packages/openapi/src/openapi-request-builder.ts +++ b/packages/openapi/src/openapi-request-builder.ts @@ -140,6 +140,16 @@ export class OpenApiRequestBuilder { ); } + /** + * Set the basePath that gets prefixed to the pathPattern of the generated client. + * @param basePath - Base path to be set. + * @returns The request builder itself, to facilitate method chaining. + */ + setBasePath(basePath: string): this { + this.basePath = basePath; + return this; + } + /** * Get http request config. * @returns Promise of http request config with origin. From 31da305b178d64dfdf20c73bd3c72ffbc81a0267 Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 6 Dec 2024 14:44:37 +0100 Subject: [PATCH 14/59] feat: introduce _defaultBasePath to the generated files --- .../src/file-serializer/api-file.ts | 5 +++-- .../src/file-serializer/operation.ts | 15 ++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index 67cacfbc21..6bc30fcb74 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -35,10 +35,11 @@ export function apiFile( const imports = serializeImports(getImports(api, options)); const apiDoc = apiDocumentation(api, serviceName); const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; - const prefixedBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; + const defaultBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; const apiContent = codeBlock` export const ${api.name} = { - ${api.operations.map(operation => serializeOperation(operation, prefixedBasePath)).join(',\n')} + _defaultBasePath: '${defaultBasePath}', + ${api.operations.map(operation => serializeOperation(operation, api.name)).join(',\n')} }; `; diff --git a/packages/openapi-generator/src/file-serializer/operation.ts b/packages/openapi-generator/src/file-serializer/operation.ts index 620b3d8d37..d4a0fc3b8a 100644 --- a/packages/openapi-generator/src/file-serializer/operation.ts +++ b/packages/openapi-generator/src/file-serializer/operation.ts @@ -9,21 +9,17 @@ import type { /** * Serialize an operation to a string. * @param operation - Operation to serialize. - * @param santisedBasePath - Sanitised base path(one leading slash and all trailing slashes removed) from optionsPerService that gets prefixed to the operation path pattern. + * @param apiName - Name of the API being serialized. * @returns The operation as a string. * @internal */ export function serializeOperation( operation: OpenApiOperation, - santisiedBasePath?: string + apiName: string ): string { - const pathPatternWithBasePath = santisiedBasePath - ? `${santisiedBasePath}${operation.pathPattern}` - : operation.pathPattern; - const requestBuilderParams = [ `'${operation.method}'`, - `"${pathPatternWithBasePath}"` + `"${operation.pathPattern}"` ]; const bodyAndQueryParams = serializeParamsForRequestBuilder(operation); @@ -33,11 +29,12 @@ export function serializeOperation( const responseType = serializeSchema(operation.response); return codeBlock` -${operationDocumentation(operation, pathPatternWithBasePath)} +${operationDocumentation(operation, operation.pathPattern)} ${operation.operationId}: (${serializeOperationSignature( operation )}) => new OpenApiRequestBuilder<${responseType}>( - ${requestBuilderParams.join(',\n')} + ${requestBuilderParams.join(',\n')}, + ${apiName}._defaultBasePath )`; } From 8917c185d1ff12142d25d6b60d791bdecace2551 Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 6 Dec 2024 16:18:35 +0100 Subject: [PATCH 15/59] chore: fix order of parameters with intro of basepath --- .../src/file-serializer/operation.ts | 3 + .../test-service/default-api.d.ts | 5 +- .../test-service/default-api.js | 9 +- .../test-service/default-api.js.map | 2 +- .../test-service/default-api.ts | 13 ++- .../test-service/entity-api.d.ts | 7 +- .../test-service/entity-api.js | 35 +++--- .../test-service/entity-api.js.map | 2 +- .../test-service/entity-api.ts | 72 +++++++++---- .../test-service/extension-api.d.ts | 5 +- .../test-service/extension-api.js | 9 +- .../test-service/extension-api.js.map | 2 +- .../test-service/extension-api.ts | 13 ++- .../test-service/tag-dot-api.d.ts | 3 +- .../test-service/tag-dot-api.js | 5 +- .../test-service/tag-dot-api.js.map | 2 +- .../test-service/tag-dot-api.ts | 7 +- .../test-service/tag-space-api.d.ts | 3 +- .../test-service/tag-space-api.js | 5 +- .../test-service/tag-space-api.js.map | 2 +- .../test-service/tag-space-api.ts | 7 +- .../test-service/test-case-api.d.ts | 31 +++--- .../test-service/test-case-api.js | 81 +++++++------- .../test-service/test-case-api.js.map | 2 +- .../test-service/test-case-api.ts | 101 +++++++++++------- 25 files changed, 254 insertions(+), 172 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/operation.ts b/packages/openapi-generator/src/file-serializer/operation.ts index d4a0fc3b8a..da7a64fa33 100644 --- a/packages/openapi-generator/src/file-serializer/operation.ts +++ b/packages/openapi-generator/src/file-serializer/operation.ts @@ -25,6 +25,9 @@ export function serializeOperation( const bodyAndQueryParams = serializeParamsForRequestBuilder(operation); if (bodyAndQueryParams) { requestBuilderParams.push(bodyAndQueryParams); + } else { + // to keep the order of the params correct while adding the base path + requestBuilderParams.push('{}'); } const responseType = serializeSchema(operation.response); diff --git a/test-packages/test-services-openapi/test-service/default-api.d.ts b/test-packages/test-services-openapi/test-service/default-api.d.ts index d32908c218..23afbe58a4 100644 --- a/test-packages/test-services-openapi/test-service/default-api.d.ts +++ b/test-packages/test-services-openapi/test-service/default-api.d.ts @@ -9,13 +9,14 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export declare const DefaultApi: { + _defaultBasePath: string; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ noTag: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ defaultTag: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/default-api.js b/test-packages/test-services-openapi/test-service/default-api.js index 559361829d..9d561ddcda 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js +++ b/test-packages/test-services-openapi/test-service/default-api.js @@ -12,15 +12,16 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.DefaultApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - noTag: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/default-tag'), + noTag: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/default-tag', {}, exports.DefaultApi._defaultBasePath), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - defaultTag: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/default-tag') + defaultTag: () => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/default-tag', {}, exports.DefaultApi._defaultBasePath) }; //# sourceMappingURL=default-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/default-api.js.map b/test-packages/test-services-openapi/test-service/default-api.js.map index dc1045121c..967aa68f76 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js.map +++ b/test-packages/test-services-openapi/test-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB;;;OAGG;IACH,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,+BAAqB,CACvB,KAAK,EACL,8CAA8C,CAC/C;IACH;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,MAAM,EACN,8CAA8C,CAC/C;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;IACH;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/default-api.ts b/test-packages/test-services-openapi/test-service/default-api.ts index d6230f6bde..06090b5590 100644 --- a/test-packages/test-services-openapi/test-service/default-api.ts +++ b/test-packages/test-services-openapi/test-service/default-api.ts @@ -9,22 +9,27 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const DefaultApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/default-tag' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ noTag: () => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/default-tag' + '/test-cases/default-tag', + {}, + DefaultApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/default-tag' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ defaultTag: () => new OpenApiRequestBuilder( 'post', - '/base/path/to/service/test-cases/default-tag' + '/test-cases/default-tag', + {}, + DefaultApi._defaultBasePath ) }; diff --git a/test-packages/test-services-openapi/test-service/entity-api.d.ts b/test-packages/test-services-openapi/test-service/entity-api.d.ts index 8ccc596d34..cecb1e4769 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.d.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.d.ts @@ -10,6 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'test-service' service. */ export declare const EntityApi: { + _defaultBasePath: string; /** * Get all entities * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. @@ -26,7 +27,7 @@ export declare const EntityApi: { enumBooleanParameter?: true | false; }) => OpenApiRequestBuilder; /** - * Create a request builder for execution of put requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of put requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -40,7 +41,7 @@ export declare const EntityApi: { */ createEntity: (body: TestEntity | undefined) => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of patch requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -48,7 +49,7 @@ export declare const EntityApi: { body: Record | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of delete requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of delete requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ diff --git a/test-packages/test-services-openapi/test-service/entity-api.js b/test-packages/test-services-openapi/test-service/entity-api.js index 66b78dcbb1..8a02c86be2 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js +++ b/test-packages/test-services-openapi/test-service/entity-api.js @@ -12,63 +12,64 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.EntityApi = { + _defaultBasePath: '/base/path/to/service', /** * Get all entities * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. * @returns The request builder, use the `execute()` method to trigger the request. */ - getAllEntities: (queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/entities', { + getAllEntities: (queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/entities', { queryParameters - }), + }, exports.EntityApi._defaultBasePath), /** - * Create a request builder for execution of put requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of put requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - updateEntityWithPut: (body) => new openapi_1.OpenApiRequestBuilder('put', '/base/path/to/service/entities', { + updateEntityWithPut: (body) => new openapi_1.OpenApiRequestBuilder('put', '/entities', { body - }), + }, exports.EntityApi._defaultBasePath), /** * Create entity * @param body - Entity to create * @returns The request builder, use the `execute()` method to trigger the request. */ - createEntity: (body) => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/entities', { + createEntity: (body) => new openapi_1.OpenApiRequestBuilder('post', '/entities', { body - }), + }, exports.EntityApi._defaultBasePath), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of patch requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - updateEntity: (body) => new openapi_1.OpenApiRequestBuilder('patch', '/base/path/to/service/entities', { + updateEntity: (body) => new openapi_1.OpenApiRequestBuilder('patch', '/entities', { body - }), + }, exports.EntityApi._defaultBasePath), /** - * Create a request builder for execution of delete requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of delete requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - deleteEntity: (body) => new openapi_1.OpenApiRequestBuilder('delete', '/base/path/to/service/entities', { + deleteEntity: (body) => new openapi_1.OpenApiRequestBuilder('delete', '/entities', { body - }), + }, exports.EntityApi._defaultBasePath), /** * Head request of entities * @returns The request builder, use the `execute()` method to trigger the request. */ - headEntities: () => new openapi_1.OpenApiRequestBuilder('head', '/base/path/to/service/entities'), + headEntities: () => new openapi_1.OpenApiRequestBuilder('head', '/entities', {}, exports.EntityApi._defaultBasePath), /** * Get entity by id * @param entityId - Key property of the entity * @returns The request builder, use the `execute()` method to trigger the request. */ - getEntityByKey: (entityId) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/entities/{entityId}', { + getEntityByKey: (entityId) => new openapi_1.OpenApiRequestBuilder('get', '/entities/{entityId}', { pathParameters: { entityId } - }), + }, exports.EntityApi._defaultBasePath), /** * Count entities * @returns The request builder, use the `execute()` method to trigger the request. */ - countEntities: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/entities/count') + countEntities: () => new openapi_1.OpenApiRequestBuilder('get', '/entities/count', {}, exports.EntityApi._defaultBasePath) }; //# sourceMappingURL=entity-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/entity-api.js.map b/test-packages/test-services-openapi/test-service/entity-api.js.map index f80589a5a5..757d74ec66 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js.map +++ b/test-packages/test-services-openapi/test-service/entity-api.js.map @@ -1 +1 @@ -{"version":3,"file":"entity-api.js","sourceRoot":"","sources":["entity-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB;;;;OAIG;IACH,cAAc,EAAE,CAAC,eAShB,EAAE,EAAE,CACH,IAAI,+BAAqB,CACvB,KAAK,EACL,gCAAgC,EAChC;QACE,eAAe;KAChB,CACF;IACH;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACtD,IAAI,+BAAqB,CAAM,KAAK,EAAE,gCAAgC,EAAE;QACtE,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC7C,IAAI,+BAAqB,CAAM,MAAM,EAAE,gCAAgC,EAAE;QACvE,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAqC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CAAM,OAAO,EAAE,gCAAgC,EAAE;QACxE,IAAI;KACL,CAAC;IACJ;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA0B,EAAE,EAAE,CAC3C,IAAI,+BAAqB,CAAM,QAAQ,EAAE,gCAAgC,EAAE;QACzE,IAAI;KACL,CAAC;IACJ;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CAAM,MAAM,EAAE,gCAAgC,CAAC;IAC1E;;;;OAIG;IACH,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CACnC,IAAI,+BAAqB,CACvB,KAAK,EACL,2CAA2C,EAC3C;QACE,cAAc,EAAE,EAAE,QAAQ,EAAE;KAC7B,CACF;IACH;;;OAGG;IACH,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,+BAAqB,CACvB,KAAK,EACL,sCAAsC,CACvC;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"entity-api.js","sourceRoot":"","sources":["entity-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,uBAAuB;IACzC;;;;OAIG;IACH,cAAc,EAAE,CAAC,eAShB,EAAE,EAAE,CACH,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,eAAe;KAChB,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC7C,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAqC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,OAAO,EACP,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA0B,EAAE,EAAE,CAC3C,IAAI,+BAAqB,CACvB,QAAQ,EACR,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CACnC,IAAI,+BAAqB,CACvB,KAAK,EACL,sBAAsB,EACtB;QACE,cAAc,EAAE,EAAE,QAAQ,EAAE;KAC7B,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,+BAAqB,CACvB,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/entity-api.ts b/test-packages/test-services-openapi/test-service/entity-api.ts index 769fee301a..b7c6ff8ddb 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.ts @@ -10,6 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'test-service' service. */ export const EntityApi = { + _defaultBasePath: '/base/path/to/service', /** * Get all entities * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. @@ -27,53 +28,79 @@ export const EntityApi = { }) => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/entities', + '/entities', { queryParameters - } + }, + EntityApi._defaultBasePath ), /** - * Create a request builder for execution of put requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of put requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ updateEntityWithPut: (body: TestEntity[] | undefined) => - new OpenApiRequestBuilder('put', '/base/path/to/service/entities', { - body - }), + new OpenApiRequestBuilder( + 'put', + '/entities', + { + body + }, + EntityApi._defaultBasePath + ), /** * Create entity * @param body - Entity to create * @returns The request builder, use the `execute()` method to trigger the request. */ createEntity: (body: TestEntity | undefined) => - new OpenApiRequestBuilder('post', '/base/path/to/service/entities', { - body - }), + new OpenApiRequestBuilder( + 'post', + '/entities', + { + body + }, + EntityApi._defaultBasePath + ), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of patch requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ updateEntity: (body: Record | undefined) => - new OpenApiRequestBuilder('patch', '/base/path/to/service/entities', { - body - }), + new OpenApiRequestBuilder( + 'patch', + '/entities', + { + body + }, + EntityApi._defaultBasePath + ), /** - * Create a request builder for execution of delete requests to the '/base/path/to/service/entities' endpoint. + * Create a request builder for execution of delete requests to the '/entities' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ deleteEntity: (body: string[] | undefined) => - new OpenApiRequestBuilder('delete', '/base/path/to/service/entities', { - body - }), + new OpenApiRequestBuilder( + 'delete', + '/entities', + { + body + }, + EntityApi._defaultBasePath + ), /** * Head request of entities * @returns The request builder, use the `execute()` method to trigger the request. */ headEntities: () => - new OpenApiRequestBuilder('head', '/base/path/to/service/entities'), + new OpenApiRequestBuilder( + 'head', + '/entities', + {}, + EntityApi._defaultBasePath + ), /** * Get entity by id * @param entityId - Key property of the entity @@ -82,10 +109,11 @@ export const EntityApi = { getEntityByKey: (entityId: string) => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/entities/{entityId}', + '/entities/{entityId}', { pathParameters: { entityId } - } + }, + EntityApi._defaultBasePath ), /** * Count entities @@ -94,6 +122,8 @@ export const EntityApi = { countEntities: () => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/entities/count' + '/entities/count', + {}, + EntityApi._defaultBasePath ) }; diff --git a/test-packages/test-services-openapi/test-service/extension-api.d.ts b/test-packages/test-services-openapi/test-service/extension-api.d.ts index 0915d6c72c..354c6b5495 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.d.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.d.ts @@ -9,13 +9,14 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export declare const ExtensionApi: { + _defaultBasePath: string; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ niceGetFunction: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ nicePostFunction: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/extension-api.js b/test-packages/test-services-openapi/test-service/extension-api.js index 6de79ed28d..772a77b348 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js +++ b/test-packages/test-services-openapi/test-service/extension-api.js @@ -12,15 +12,16 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.ExtensionApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - niceGetFunction: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/extension'), + niceGetFunction: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/extension', {}, exports.ExtensionApi._defaultBasePath), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - nicePostFunction: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/extension') + nicePostFunction: () => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/extension', {}, exports.ExtensionApi._defaultBasePath) }; //# sourceMappingURL=extension-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/extension-api.js.map b/test-packages/test-services-openapi/test-service/extension-api.js.map index 3d14f73d16..ceb448b71e 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js.map +++ b/test-packages/test-services-openapi/test-service/extension-api.js.map @@ -1 +1 @@ -{"version":3,"file":"extension-api.js","sourceRoot":"","sources":["extension-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE,CACpB,IAAI,+BAAqB,CACvB,KAAK,EACL,4CAA4C,CAC7C;IACH;;;OAGG;IACH,gBAAgB,EAAE,GAAG,EAAE,CACrB,IAAI,+BAAqB,CACvB,MAAM,EACN,4CAA4C,CAC7C;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"extension-api.js","sourceRoot":"","sources":["extension-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE,CACpB,IAAI,+BAAqB,CACvB,KAAK,EACL,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;IACH;;;OAGG;IACH,gBAAgB,EAAE,GAAG,EAAE,CACrB,IAAI,+BAAqB,CACvB,MAAM,EACN,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/extension-api.ts b/test-packages/test-services-openapi/test-service/extension-api.ts index 59dddbe16a..ad8e75d7b6 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.ts @@ -9,22 +9,27 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const ExtensionApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/extension' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ niceGetFunction: () => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/extension' + '/test-cases/extension', + {}, + ExtensionApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/extension' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ nicePostFunction: () => new OpenApiRequestBuilder( 'post', - '/base/path/to/service/test-cases/extension' + '/test-cases/extension', + {}, + ExtensionApi._defaultBasePath ) }; diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts index 631c376f58..f7b07b35b9 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts @@ -9,8 +9,9 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export declare const TagDotApi: { + _defaultBasePath: string; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithDot: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js b/test-packages/test-services-openapi/test-service/tag-dot-api.js index 518041d39c..d300a8a85f 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js @@ -12,10 +12,11 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TagDotApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - tagWithDot: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/special-tag') + tagWithDot: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/special-tag', {}, exports.TagDotApi._defaultBasePath) }; //# sourceMappingURL=tag-dot-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js.map b/test-packages/test-services-openapi/test-service/tag-dot-api.js.map index 2f3b6453a8..61b7653c24 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js.map +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js.map @@ -1 +1 @@ -{"version":3,"file":"tag-dot-api.js","sourceRoot":"","sources":["tag-dot-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,KAAK,EACL,8CAA8C,CAC/C;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"tag-dot-api.js","sourceRoot":"","sources":["tag-dot-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.ts index d16720dabe..aa549e7465 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.ts @@ -9,13 +9,16 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const TagDotApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/special-tag' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithDot: () => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/special-tag' + '/test-cases/special-tag', + {}, + TagDotApi._defaultBasePath ) }; diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.d.ts b/test-packages/test-services-openapi/test-service/tag-space-api.d.ts index 8a38b53069..ab682d8d0f 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.d.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.d.ts @@ -9,8 +9,9 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export declare const TagSpaceApi: { + _defaultBasePath: string; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithSpace: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js b/test-packages/test-services-openapi/test-service/tag-space-api.js index 6e3f6505b2..45c655ac10 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js @@ -12,10 +12,11 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TagSpaceApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - tagWithSpace: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/special-tag') + tagWithSpace: () => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/special-tag', {}, exports.TagSpaceApi._defaultBasePath) }; //# sourceMappingURL=tag-space-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js.map b/test-packages/test-services-openapi/test-service/tag-space-api.js.map index 643e307ef3..e12f45e314 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js.map +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js.map @@ -1 +1 @@ -{"version":3,"file":"tag-space-api.js","sourceRoot":"","sources":["tag-space-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,8CAA8C,CAC/C;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"tag-space-api.js","sourceRoot":"","sources":["tag-space-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.ts b/test-packages/test-services-openapi/test-service/tag-space-api.ts index b2acdd5c16..65c38de932 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.ts @@ -9,13 +9,16 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const TagSpaceApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/special-tag' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ tagWithSpace: () => new OpenApiRequestBuilder( 'post', - '/base/path/to/service/test-cases/special-tag' + '/test-cases/special-tag', + {}, + TagSpaceApi._defaultBasePath ) }; diff --git a/test-packages/test-services-openapi/test-service/test-case-api.d.ts b/test-packages/test-services-openapi/test-service/test-case-api.d.ts index d4ba9b2502..9384c7d86f 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.d.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.d.ts @@ -15,8 +15,9 @@ import type { * This API is part of the 'test-service' service. */ export declare const TestCaseApi: { + _defaultBasePath: string; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. @@ -33,7 +34,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. @@ -50,7 +51,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -64,7 +65,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. @@ -80,7 +81,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. @@ -96,7 +97,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -108,27 +109,27 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1_1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId_1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1: () => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. @@ -140,7 +141,7 @@ export declare const TestCaseApi: { } ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -148,7 +149,7 @@ export declare const TestCaseApi: { body: ComplexTestEntity | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -156,7 +157,7 @@ export declare const TestCaseApi: { body: SimpleTestEntityWITHSymbols | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ @@ -164,7 +165,7 @@ export declare const TestCaseApi: { body: Schema123456 | undefined ) => OpenApiRequestBuilder; /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ getTestCasesNoOperationId: () => OpenApiRequestBuilder; diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js b/test-packages/test-services-openapi/test-service/test-case-api.js index b08048046d..b16f090ef3 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js +++ b/test-packages/test-services-openapi/test-service/test-case-api.js @@ -12,132 +12,133 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TestCaseApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseGetRequiredParameters: (requiredPathItemPathParam, body, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { + testCaseGetRequiredParameters: (requiredPathItemPathParam, body, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { pathParameters: { requiredPathItemPathParam }, body, queryParameters - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCasePostRequiredParameters: (requiredPathItemPathParam, body, queryParameters) => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { + testCasePostRequiredParameters: (requiredPathItemPathParam, body, queryParameters) => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { pathParameters: { requiredPathItemPathParam }, body, queryParameters - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseRequiredQueryOptionalHeader: (queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/parameters', { + testCaseRequiredQueryOptionalHeader: (queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/parameters', { queryParameters, headerParameters - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseOptionalQueryRequiredHeader: (body, queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/parameters', { + testCaseOptionalQueryRequiredHeader: (body, queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/parameters', { body, queryParameters, headerParameters - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseOptionalQueryOptionalHeader: (body, queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('patch', '/base/path/to/service/test-cases/parameters', { + testCaseOptionalQueryOptionalHeader: (body, queryParameters, headerParameters) => new openapi_1.OpenApiRequestBuilder('patch', '/test-cases/parameters', { body, queryParameters, headerParameters - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. */ - testCaseGetDuplicateParameters: (duplicateParam, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/parameters/{duplicateParam}', { + testCaseGetDuplicateParameters: (duplicateParam, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/parameters/{duplicateParam}', { pathParameters: { duplicateParam }, queryParameters - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - duplicateOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/duplicate-operation-ids'), + duplicateOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/duplicate-operation-ids', {}, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - duplicateOperationId1_1: () => new openapi_1.OpenApiRequestBuilder('put', '/base/path/to/service/test-cases/duplicate-operation-ids'), + duplicateOperationId1_1: () => new openapi_1.OpenApiRequestBuilder('put', '/test-cases/duplicate-operation-ids', {}, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - duplicateOperationId_1: () => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/duplicate-operation-ids'), + duplicateOperationId_1: () => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/duplicate-operation-ids', {}, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - duplicateOperationId1: () => new openapi_1.OpenApiRequestBuilder('patch', '/base/path/to/service/test-cases/duplicate-operation-ids'), + duplicateOperationId1: () => new openapi_1.OpenApiRequestBuilder('patch', '/test-cases/duplicate-operation-ids', {}, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. */ - export: (const1, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/reserved-keywords/{const1}', { + export: (const1, queryParameters) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/reserved-keywords/{const1}', { pathParameters: { const1 }, queryParameters - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - complexSchemas: (body) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/complex-schemas', { + complexSchemas: (body) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/complex-schemas', { body - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - useNameWithSymbols: (body) => new openapi_1.OpenApiRequestBuilder('post', '/base/path/to/service/test-cases/complex-schemas', { + useNameWithSymbols: (body) => new openapi_1.OpenApiRequestBuilder('post', '/test-cases/complex-schemas', { body - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ - schemaNameInteger: (body) => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/schema-name-integer', { + schemaNameInteger: (body) => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/schema-name-integer', { body - }), + }, exports.TestCaseApi._defaultBasePath), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - getTestCasesNoOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/base/path/to/service/test-cases/no-operation-id') + getTestCasesNoOperationId: () => new openapi_1.OpenApiRequestBuilder('get', '/test-cases/no-operation-id', {}, exports.TestCaseApi._defaultBasePath) }; //# sourceMappingURL=test-case-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js.map b/test-packages/test-services-openapi/test-service/test-case-api.js.map index a7e8e7f6f1..fc5b33a818 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js.map +++ b/test-packages/test-services-openapi/test-service/test-case-api.js.map @@ -1 +1 @@ -{"version":3,"file":"test-case-api.js","sourceRoot":"","sources":["test-case-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAO/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB;;;;;;OAMG;IACH,6BAA6B,EAAE,CAC7B,yBAAiC,EACjC,IAAkC,EAClC,eAKC,EACD,EAAE,CACF,IAAI,+BAAqB,CACvB,KAAK,EACL,6FAA6F,EAC7F;QACE,cAAc,EAAE,EAAE,yBAAyB,EAAE;QAC7C,IAAI;QACJ,eAAe;KAChB,CACF;IACH;;;;;;OAMG;IACH,8BAA8B,EAAE,CAC9B,yBAAiC,EACjC,IAAsB,EACtB,eAKC,EACD,EAAE,CACF,IAAI,+BAAqB,CACvB,MAAM,EACN,6FAA6F,EAC7F;QACE,cAAc,EAAE,EAAE,yBAAyB,EAAE;QAC7C,IAAI;QACJ,eAAe;KAChB,CACF;IACH;;;;;OAKG;IACH,mCAAmC,EAAE,CACnC,eAA+C,EAC/C,gBAAmD,EACnD,EAAE,CACF,IAAI,+BAAqB,CACvB,KAAK,EACL,6CAA6C,EAC7C;QACE,eAAe;QACf,gBAAgB;KACjB,CACF;IACH;;;;;;OAMG;IACH,mCAAmC,EAAE,CACnC,IAAsB,EACtB,eAAgD,EAChD,gBAAiD,EACjD,EAAE,CACF,IAAI,+BAAqB,CACvB,MAAM,EACN,6CAA6C,EAC7C;QACE,IAAI;QACJ,eAAe;QACf,gBAAgB;KACjB,CACF;IACH;;;;;;OAMG;IACH,mCAAmC,EAAE,CACnC,IAAsB,EACtB,eAAiD,EACjD,gBAAmD,EACnD,EAAE,CACF,IAAI,+BAAqB,CACvB,OAAO,EACP,6CAA6C,EAC7C;QACE,IAAI;QACJ,eAAe;QACf,gBAAgB;KACjB,CACF;IACH;;;;;OAKG;IACH,8BAA8B,EAAE,CAC9B,cAAsB,EACtB,eAA2C,EAC3C,EAAE,CACF,IAAI,+BAAqB,CACvB,KAAK,EACL,8DAA8D,EAC9D;QACE,cAAc,EAAE,EAAE,cAAc,EAAE;QAClC,eAAe;KAChB,CACF;IACH;;;OAGG;IACH,oBAAoB,EAAE,GAAG,EAAE,CACzB,IAAI,+BAAqB,CACvB,KAAK,EACL,0DAA0D,CAC3D;IACH;;;OAGG;IACH,uBAAuB,EAAE,GAAG,EAAE,CAC5B,IAAI,+BAAqB,CACvB,KAAK,EACL,0DAA0D,CAC3D;IACH;;;OAGG;IACH,sBAAsB,EAAE,GAAG,EAAE,CAC3B,IAAI,+BAAqB,CACvB,MAAM,EACN,0DAA0D,CAC3D;IACH;;;OAGG;IACH,qBAAqB,EAAE,GAAG,EAAE,CAC1B,IAAI,+BAAqB,CACvB,OAAO,EACP,0DAA0D,CAC3D;IACH;;;;;OAKG;IACH,MAAM,EAAE,CAAC,MAAc,EAAE,eAAkC,EAAE,EAAE,CAC7D,IAAI,+BAAqB,CACvB,KAAK,EACL,6DAA6D,EAC7D;QACE,cAAc,EAAE,EAAE,MAAM,EAAE;QAC1B,eAAe;KAChB,CACF;IACH;;;;OAIG;IACH,cAAc,EAAE,CAAC,IAAmC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,KAAK,EACL,kDAAkD,EAClD;QACE,IAAI;KACL,CACF;IACH;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,IAA6C,EAAE,EAAE,CACpE,IAAI,+BAAqB,CACvB,MAAM,EACN,kDAAkD,EAClD;QACE,IAAI;KACL,CACF;IACH;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACpD,IAAI,+BAAqB,CACvB,KAAK,EACL,sDAAsD,EACtD;QACE,IAAI;KACL,CACF;IACH;;;OAGG;IACH,yBAAyB,EAAE,GAAG,EAAE,CAC9B,IAAI,+BAAqB,CACvB,KAAK,EACL,kDAAkD,CACnD;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"test-case-api.js","sourceRoot":"","sources":["test-case-api.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/test-case-api.ts b/test-packages/test-services-openapi/test-service/test-case-api.ts index 829ca84397..f29f589339 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.ts @@ -15,8 +15,9 @@ import type { * This API is part of the 'test-service' service. */ export const TestCaseApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam, optionalPathItemQueryParam. @@ -34,15 +35,16 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', + '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { pathParameters: { requiredPathItemPathParam }, body, queryParameters - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalPathItemQueryParam, requiredPathItemQueryParam, optionalQueryParam, requiredQueryParam. @@ -60,15 +62,16 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'post', - '/base/path/to/service/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', + '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}', { pathParameters: { requiredPathItemPathParam }, body, queryParameters - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters' endpoint. * @param queryParameters - Object containing the following keys: requiredQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -79,14 +82,15 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/parameters', + '/test-cases/parameters', { queryParameters, headerParameters - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: requiredHeaderParam. @@ -99,15 +103,16 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'post', - '/base/path/to/service/test-cases/parameters', + '/test-cases/parameters', { body, queryParameters, headerParameters - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/parameters' endpoint. + * Create a request builder for execution of patch requests to the '/test-cases/parameters' endpoint. * @param body - Request body. * @param queryParameters - Object containing the following keys: optionalQueryParam. * @param headerParameters - Object containing the following keys: optionalHeaderParam. @@ -120,15 +125,16 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'patch', - '/base/path/to/service/test-cases/parameters', + '/test-cases/parameters', { body, queryParameters, headerParameters - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/parameters/{duplicateParam}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/parameters/{duplicateParam}' endpoint. * @param duplicateParam - Path parameter. * @param queryParameters - Object containing the following keys: duplicateParam. * @returns The request builder, use the `execute()` method to trigger the request. @@ -139,50 +145,59 @@ export const TestCaseApi = { ) => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/parameters/{duplicateParam}', + '/test-cases/parameters/{duplicateParam}', { pathParameters: { duplicateParam }, queryParameters - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId: () => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/duplicate-operation-ids' + '/test-cases/duplicate-operation-ids', + {}, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of put requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of put requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1_1: () => new OpenApiRequestBuilder( 'put', - '/base/path/to/service/test-cases/duplicate-operation-ids' + '/test-cases/duplicate-operation-ids', + {}, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId_1: () => new OpenApiRequestBuilder( 'post', - '/base/path/to/service/test-cases/duplicate-operation-ids' + '/test-cases/duplicate-operation-ids', + {}, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of patch requests to the '/base/path/to/service/test-cases/duplicate-operation-ids' endpoint. + * Create a request builder for execution of patch requests to the '/test-cases/duplicate-operation-ids' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ duplicateOperationId1: () => new OpenApiRequestBuilder( 'patch', - '/base/path/to/service/test-cases/duplicate-operation-ids' + '/test-cases/duplicate-operation-ids', + {}, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/reserved-keywords/{const1}' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/reserved-keywords/{const1}' endpoint. * @param const1 - Path parameter. * @param queryParameters - Object containing the following keys: const. * @returns The request builder, use the `execute()` method to trigger the request. @@ -190,58 +205,64 @@ export const TestCaseApi = { export: (const1: string, queryParameters: { const: string }) => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/reserved-keywords/{const1}', + '/test-cases/reserved-keywords/{const1}', { pathParameters: { const1 }, queryParameters - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ complexSchemas: (body: ComplexTestEntity | undefined) => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/complex-schemas', + '/test-cases/complex-schemas', { body - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the '/base/path/to/service/test-cases/complex-schemas' endpoint. + * Create a request builder for execution of post requests to the '/test-cases/complex-schemas' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ useNameWithSymbols: (body: SimpleTestEntityWITHSymbols | undefined) => new OpenApiRequestBuilder( 'post', - '/base/path/to/service/test-cases/complex-schemas', + '/test-cases/complex-schemas', { body - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/schema-name-integer' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/schema-name-integer' endpoint. * @param body - Request body. * @returns The request builder, use the `execute()` method to trigger the request. */ schemaNameInteger: (body: Schema123456 | undefined) => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/schema-name-integer', + '/test-cases/schema-name-integer', { body - } + }, + TestCaseApi._defaultBasePath ), /** - * Create a request builder for execution of get requests to the '/base/path/to/service/test-cases/no-operation-id' endpoint. + * Create a request builder for execution of get requests to the '/test-cases/no-operation-id' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ getTestCasesNoOperationId: () => new OpenApiRequestBuilder( 'get', - '/base/path/to/service/test-cases/no-operation-id' + '/test-cases/no-operation-id', + {}, + TestCaseApi._defaultBasePath ) }; From aa91a334bfb3a3649ef68cf597ca1328152dd34b Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 6 Dec 2024 16:41:25 +0100 Subject: [PATCH 16/59] chore: fix tests --- .../__snapshots__/api-file.spec.ts.snap | 38 +++++++---- .../__snapshots__/operation.spec.ts.snap | 3 +- .../src/file-serializer/operation.spec.ts | 64 +++++++++++-------- 3 files changed, 65 insertions(+), 40 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap index 7a68d26484..e960a98064 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap @@ -8,6 +8,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema/index.j * This API is part of the 'MyServiceName' service. */ export const TestApi = { + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. @@ -22,7 +23,8 @@ export const TestApi = { pathParameters: { id }, queryParameters, headerParameters - } + }, + TestApi._defaultBasePath ), /** * Create a request builder for execution of post requests to the 'test' endpoint. @@ -34,7 +36,8 @@ export const TestApi = { "test", { body - } + }, + TestApi._defaultBasePath ) };" `; @@ -46,13 +49,16 @@ exports[`api-file creates an api file with documentation 1`] = ` * This API is part of the 'TestService' service. */ export const TestApi = { + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the 'test' endpoint. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: () => new OpenApiRequestBuilder( 'get', - "test" + "test", + {}, + TestApi._defaultBasePath ) };" `; @@ -72,6 +78,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; * This API is part of the 'MyServiceName' service. */ export const TestApi = { + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. @@ -86,7 +93,8 @@ export const TestApi = { pathParameters: { id }, queryParameters, headerParameters - } + }, + TestApi._defaultBasePath ), /** * Create a request builder for execution of post requests to the 'test' endpoint. @@ -98,7 +106,8 @@ export const TestApi = { "test", { body - } + }, + TestApi._defaultBasePath ) };" `; @@ -111,8 +120,9 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; * This API is part of the 'MyServiceName' service. */ export const TestApi = { + _defaultBasePath: '/base/path/to/service', /** - * Create a request builder for execution of get requests to the '/base/path/to/servicetest/{id}' endpoint. + * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. * @param queryParameters - Object containing the following keys: queryParam. * @param headerParameters - Object containing the following keys: headerParam. @@ -120,24 +130,26 @@ export const TestApi = { */ getFn: (id: string, queryParameters: {'queryParam': QueryParameterType}, headerParameters?: {'headerParam'?: string}) => new OpenApiRequestBuilder( 'get', - "/base/path/to/servicetest/{id}", + "test/{id}", { pathParameters: { id }, queryParameters, headerParameters - } + }, + TestApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the '/base/path/to/servicetest' endpoint. + * Create a request builder for execution of post requests to the 'test' endpoint. * @param body - Request body. * @returns The request builder, use the \`execute()\` method to trigger the request. */ createFn: (body: RefType) => new OpenApiRequestBuilder( 'post', - "/base/path/to/servicetest", + "test", { body - } + }, + TestApi._defaultBasePath ) };" `; @@ -149,6 +161,7 @@ exports[`api-file serializes api file with one operation and no references 1`] = * This API is part of the 'MyServiceName' service. */ export const TestApi = { + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. @@ -159,7 +172,8 @@ export const TestApi = { "test/{id}", { pathParameters: { id } - } + }, + TestApi._defaultBasePath ) };" `; diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/operation.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/operation.spec.ts.snap index cb3a2560fc..834a6c973a 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/operation.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/operation.spec.ts.snap @@ -11,6 +11,7 @@ getFn: (id: string) => new OpenApiRequestBuilder>( "/test('{id}')", { pathParameters: { id } - } + }, + TestApi._defaultBasePath )" `; diff --git a/packages/openapi-generator/src/file-serializer/operation.spec.ts b/packages/openapi-generator/src/file-serializer/operation.spec.ts index de1e0547e0..35c76cf7ee 100644 --- a/packages/openapi-generator/src/file-serializer/operation.spec.ts +++ b/packages/openapi-generator/src/file-serializer/operation.spec.ts @@ -6,6 +6,7 @@ import type { } from '../openapi-types'; describe('serializeOperation', () => { + const apiName = 'TestApi'; it('serializes operation with path, query and header parameters', () => { const operation: OpenApiOperation = { operationId: 'getFn', @@ -51,7 +52,7 @@ describe('serializeOperation', () => { response: { type: 'string' }, pathPattern: '/test/{id}/{subId}' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of get requests to the '/test/{id}/{subId}' endpoint. * @param id - Path parameter. @@ -67,7 +68,8 @@ describe('serializeOperation', () => { pathParameters: { id, subId }, queryParameters, headerParameters - } + }, + TestApi._defaultBasePath )" `); }); @@ -101,21 +103,20 @@ describe('serializeOperation', () => { response: { type: 'string' }, pathPattern: '/test/{id}/{subId}' }; - const santisedBasePath = '/base/path'; - expect(serializeOperation(operation, santisedBasePath)) - .toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** - * Create a request builder for execution of get requests to the '/base/path/test/{id}/{subId}' endpoint. + * Create a request builder for execution of get requests to the '/test/{id}/{subId}' endpoint. * @param id - Path parameter. * @param subId - Path parameter. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (id: string, subId: string) => new OpenApiRequestBuilder( 'get', - "/base/path/test/{id}/{subId}", + "/test/{id}/{subId}", { pathParameters: { id, subId } - } + }, + TestApi._defaultBasePath )" `); }); @@ -153,7 +154,7 @@ describe('serializeOperation', () => { pathPattern: '/test/{id}' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of delete requests to the '/test/{id}' endpoint. * @param id - Path parameter. @@ -166,7 +167,8 @@ describe('serializeOperation', () => { { pathParameters: { id }, headerParameters - } + }, + TestApi._defaultBasePath )" `); }); @@ -196,7 +198,7 @@ describe('serializeOperation', () => { pathPattern: '/test/{id}' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of delete requests to the '/test/{id}' endpoint. * @param id - Path parameter. @@ -207,7 +209,8 @@ describe('serializeOperation', () => { "/test/{id}", { pathParameters: { id } - } + }, + TestApi._defaultBasePath )" `); }); @@ -237,7 +240,7 @@ describe('serializeOperation', () => { pathPattern: "/test('{id}')" }; - expect(serializeOperation(operation)).toMatchSnapshot(); + expect(serializeOperation(operation, apiName)).toMatchSnapshot(); }); it('serializes operation with optional query and required header parameters', () => { @@ -279,7 +282,7 @@ describe('serializeOperation', () => { pathPattern: '/test' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit, page. @@ -292,7 +295,8 @@ describe('serializeOperation', () => { { queryParameters, headerParameters - } + }, + TestApi._defaultBasePath )" `); }); @@ -344,7 +348,7 @@ describe('serializeOperation', () => { pathPattern: '/test' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit, page. @@ -357,7 +361,8 @@ describe('serializeOperation', () => { { queryParameters, headerParameters - } + }, + TestApi._defaultBasePath )" `); }); @@ -393,7 +398,7 @@ describe('serializeOperation', () => { pathPattern: '/test' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit. @@ -406,7 +411,8 @@ describe('serializeOperation', () => { { queryParameters, headerParameters - } + }, + TestApi._defaultBasePath )" `); }); @@ -450,7 +456,7 @@ describe('serializeOperation', () => { pathPattern: '/test' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit, page. @@ -463,7 +469,8 @@ describe('serializeOperation', () => { { queryParameters, headerParameters - } + }, + TestApi._defaultBasePath )" `); }); @@ -489,7 +496,7 @@ describe('serializeOperation', () => { pathPattern: '/test' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of get requests to the '/test' endpoint. * @param queryParameters - Object containing the following keys: limit. @@ -500,7 +507,8 @@ describe('serializeOperation', () => { "/test", { queryParameters - } + }, + TestApi._defaultBasePath )" `); }); @@ -533,7 +541,7 @@ describe('serializeOperation', () => { response: { type: 'any' }, pathPattern: '/test/{id}' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of post requests to the '/test/{id}' endpoint. * @param id - Path parameter. @@ -546,7 +554,8 @@ describe('serializeOperation', () => { { pathParameters: { id }, body - } + }, + TestApi._defaultBasePath )" `); }); @@ -571,7 +580,7 @@ describe('serializeOperation', () => { pathPattern: '/test' }; - expect(serializeOperation(operation)).toMatchInlineSnapshot(` + expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` "/** * Create a request builder for execution of post requests to the '/test' endpoint. * @param body - Request body. @@ -582,7 +591,8 @@ describe('serializeOperation', () => { "/test", { body - } + }, + TestApi._defaultBasePath )" `); }); From e129c100f94650130c17abbcf963f901eb723a08 Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 6 Dec 2024 17:21:17 +0100 Subject: [PATCH 17/59] chore: add setBasePath --- .../src/openapi-request-builder.spec.ts | 21 +++++++++++++++++++ .../openapi/src/openapi-request-builder.ts | 7 +++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/packages/openapi/src/openapi-request-builder.spec.ts b/packages/openapi/src/openapi-request-builder.spec.ts index 3c56841f4c..190057fb49 100644 --- a/packages/openapi/src/openapi-request-builder.spec.ts +++ b/packages/openapi/src/openapi-request-builder.spec.ts @@ -76,6 +76,27 @@ describe('openapi-request-builder', () => { expect(response.data).toBe(dummyResponse); }); + it('executeRaw executes a request without parameters and basePath explicitly set', async () => { + const requestBuilder = new OpenApiRequestBuilder( + 'get', + '/test' + ).setBasePath('/base/path/to/service/'); + const response = await requestBuilder.executeRaw(destination); + expect(httpClient.executeHttpRequest).toHaveBeenCalledWith( + sanitizeDestination(destination), + { + method: 'get', + middleware: [], + url: '/base/path/to/service/test', + headers: { requestConfig: {} }, + params: { requestConfig: {} }, + data: undefined + }, + { fetchCsrfToken: false } + ); + expect(response.data).toBe(dummyResponse); + }); + it('executeRaw executes a request with header parameters', async () => { const destinationWithAuth = { ...destination, diff --git a/packages/openapi/src/openapi-request-builder.ts b/packages/openapi/src/openapi-request-builder.ts index 0b3732727e..39d8313783 100644 --- a/packages/openapi/src/openapi-request-builder.ts +++ b/packages/openapi/src/openapi-request-builder.ts @@ -2,6 +2,7 @@ // eslint-disable-next-line import/named import { isNullish, + removeSlashes, transformVariadicArgumentToArray } from '@sap-cloud-sdk/util'; import { useOrFetchDestination } from '@sap-cloud-sdk/connectivity'; @@ -141,12 +142,14 @@ export class OpenApiRequestBuilder { } /** - * Set the basePath that gets prefixed to the pathPattern of the generated client. + * Set the basePath that gets prefixed to the pathPattern before a request. * @param basePath - Base path to be set. * @returns The request builder itself, to facilitate method chaining. */ setBasePath(basePath: string): this { - this.basePath = basePath; + const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; + const fixedBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; + this.basePath = fixedBasePath; return this; } From e366dd7a397fc9b387cf49912e6d0de91f39abbb Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 11:16:22 +0100 Subject: [PATCH 18/59] chore: fix failing e2e test --- .../generate-openapi-services.ts | 18 +++---------- .../no-schema-service/default-api.d.ts | 1 + .../no-schema-service/default-api.js | 3 ++- .../no-schema-service/default-api.js.map | 2 +- .../no-schema-service/default-api.ts | 4 ++- .../swagger-yaml-service/default-api.d.ts | 1 + .../swagger-yaml-service/default-api.js | 5 ++-- .../swagger-yaml-service/default-api.js.map | 2 +- .../swagger-yaml-service/default-api.ts | 27 +++++++++++++------ .../test-service/default-api.js | 2 +- .../test-service/default-api.js.map | 2 +- .../test-service/default-api.ts | 2 +- .../test-service/entity-api.js | 2 +- .../test-service/entity-api.js.map | 2 +- .../test-service/entity-api.ts | 2 +- .../test-service/extension-api.js | 2 +- .../test-service/extension-api.js.map | 2 +- .../test-service/extension-api.ts | 2 +- .../test-service/tag-dot-api.js | 2 +- .../test-service/tag-dot-api.js.map | 2 +- .../test-service/tag-dot-api.ts | 2 +- .../test-service/tag-space-api.js | 2 +- .../test-service/tag-space-api.js.map | 2 +- .../test-service/tag-space-api.ts | 2 +- .../test-service/test-case-api.js | 2 +- .../test-service/test-case-api.js.map | 2 +- .../test-service/test-case-api.ts | 2 +- .../options-per-service.json | 7 ----- 28 files changed, 52 insertions(+), 54 deletions(-) delete mode 100644 test-resources/openapi-service-specs/options-per-service.json diff --git a/test-packages/test-services-openapi/generate-openapi-services.ts b/test-packages/test-services-openapi/generate-openapi-services.ts index 7fa0cadb98..0fccaec126 100644 --- a/test-packages/test-services-openapi/generate-openapi-services.ts +++ b/test-packages/test-services-openapi/generate-openapi-services.ts @@ -20,26 +20,14 @@ async function generateOpenApi() { '..', '..', 'test-resources', - 'openapi-service-specs', - 'test-service.json' + 'openapi-service-specs' ), outputDir: resolve('.'), - transpile: true, - optionsPerService: resolve( - '..', - '..', - 'test-resources', - 'openapi-service-specs', - 'options-per-service.json' - ) + transpile: true }).catch(reason => { logger.error(`Unhandled rejection at: ${reason}`); process.exit(1); }); } -try { - generateOpenApi(); -} catch (error) { - console.log(error); -} +generateOpenApi(); \ No newline at end of file diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.d.ts b/test-packages/test-services-openapi/no-schema-service/default-api.d.ts index ec3694d581..015cf44e51 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.d.ts +++ b/test-packages/test-services-openapi/no-schema-service/default-api.d.ts @@ -9,6 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'no-schema-service' service. */ export declare const DefaultApi: { + _defaultBasePath: string; /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.js b/test-packages/test-services-openapi/no-schema-service/default-api.js index f53587e333..18925e6009 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.js +++ b/test-packages/test-services-openapi/no-schema-service/default-api.js @@ -12,10 +12,11 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'no-schema-service' service. */ exports.DefaultApi = { + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - get: () => new openapi_1.OpenApiRequestBuilder('get', '/') + get: () => new openapi_1.OpenApiRequestBuilder('get', '/', {}, exports.DefaultApi._defaultBasePath) }; //# sourceMappingURL=default-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.js.map b/test-packages/test-services-openapi/no-schema-service/default-api.js.map index d28ca80124..7c1290e2d1 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.js.map +++ b/test-packages/test-services-openapi/no-schema-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB;;;OAGG;IACH,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,+BAAqB,CAAM,KAAK,EAAE,GAAG,CAAC;CACtD,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,GAAG,EAAE,GAAG,EAAE,CACR,IAAI,+BAAqB,CAAM,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAU,CAAC,gBAAgB,CAAC;CAC9E,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.ts b/test-packages/test-services-openapi/no-schema-service/default-api.ts index d8a14c1bbc..613f18b524 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.ts +++ b/test-packages/test-services-openapi/no-schema-service/default-api.ts @@ -9,9 +9,11 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'no-schema-service' service. */ export const DefaultApi = { + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. */ - get: () => new OpenApiRequestBuilder('get', '/') + get: () => + new OpenApiRequestBuilder('get', '/', {}, DefaultApi._defaultBasePath) }; diff --git a/test-packages/test-services-openapi/swagger-yaml-service/default-api.d.ts b/test-packages/test-services-openapi/swagger-yaml-service/default-api.d.ts index 51ac2ffe0e..1d362af3e1 100644 --- a/test-packages/test-services-openapi/swagger-yaml-service/default-api.d.ts +++ b/test-packages/test-services-openapi/swagger-yaml-service/default-api.d.ts @@ -10,6 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'swagger-yaml-service' service. */ export declare const DefaultApi: { + _defaultBasePath: string; /** * Test POST * @param pathParam - Path parameter. diff --git a/test-packages/test-services-openapi/swagger-yaml-service/default-api.js b/test-packages/test-services-openapi/swagger-yaml-service/default-api.js index e4349fc1e4..a8691ee19f 100644 --- a/test-packages/test-services-openapi/swagger-yaml-service/default-api.js +++ b/test-packages/test-services-openapi/swagger-yaml-service/default-api.js @@ -12,6 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'swagger-yaml-service' service. */ exports.DefaultApi = { + _defaultBasePath: '', /** * Test POST * @param pathParam - Path parameter. @@ -21,7 +22,7 @@ exports.DefaultApi = { postEntity: (pathParam, queryParameters) => new openapi_1.OpenApiRequestBuilder('post', '/entities/{pathParam}', { pathParameters: { pathParam }, queryParameters - }), + }, exports.DefaultApi._defaultBasePath), /** * Create a request builder for execution of patch requests to the '/entities/{pathParam}' endpoint. * @param pathParam - Path parameter. @@ -31,6 +32,6 @@ exports.DefaultApi = { patchEntity: (pathParam, body) => new openapi_1.OpenApiRequestBuilder('patch', '/entities/{pathParam}', { pathParameters: { pathParam }, body - }) + }, exports.DefaultApi._defaultBasePath) }; //# sourceMappingURL=default-api.js.map \ No newline at end of file diff --git a/test-packages/test-services-openapi/swagger-yaml-service/default-api.js.map b/test-packages/test-services-openapi/swagger-yaml-service/default-api.js.map index 278e603868..07cb8a1ea8 100644 --- a/test-packages/test-services-openapi/swagger-yaml-service/default-api.js.map +++ b/test-packages/test-services-openapi/swagger-yaml-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB;;;;;OAKG;IACH,UAAU,EAAE,CAAC,SAAiB,EAAE,eAAyC,EAAE,EAAE,CAC3E,IAAI,+BAAqB,CAAe,MAAM,EAAE,uBAAuB,EAAE;QACvE,cAAc,EAAE,EAAE,SAAS,EAAE;QAC7B,eAAe;KAChB,CAAC;IACJ;;;;;OAKG;IACH,WAAW,EAAE,CAAC,SAAiB,EAAE,IAA4B,EAAE,EAAE,CAC/D,IAAI,+BAAqB,CAAS,OAAO,EAAE,uBAAuB,EAAE;QAClE,cAAc,EAAE,EAAE,SAAS,EAAE;QAC7B,IAAI;KACL,CAAC;CACL,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,EAAE;IACpB;;;;;OAKG;IACH,UAAU,EAAE,CAAC,SAAiB,EAAE,eAAyC,EAAE,EAAE,CAC3E,IAAI,+BAAqB,CACvB,MAAM,EACN,uBAAuB,EACvB;QACE,cAAc,EAAE,EAAE,SAAS,EAAE;QAC7B,eAAe;KAChB,EACD,kBAAU,CAAC,gBAAgB,CAC5B;IACH;;;;;OAKG;IACH,WAAW,EAAE,CAAC,SAAiB,EAAE,IAA4B,EAAE,EAAE,CAC/D,IAAI,+BAAqB,CACvB,OAAO,EACP,uBAAuB,EACvB;QACE,cAAc,EAAE,EAAE,SAAS,EAAE;QAC7B,IAAI;KACL,EACD,kBAAU,CAAC,gBAAgB,CAC5B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/swagger-yaml-service/default-api.ts b/test-packages/test-services-openapi/swagger-yaml-service/default-api.ts index 7f11b8cbcc..c097213023 100644 --- a/test-packages/test-services-openapi/swagger-yaml-service/default-api.ts +++ b/test-packages/test-services-openapi/swagger-yaml-service/default-api.ts @@ -10,6 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'swagger-yaml-service' service. */ export const DefaultApi = { + _defaultBasePath: '', /** * Test POST * @param pathParam - Path parameter. @@ -17,10 +18,15 @@ export const DefaultApi = { * @returns The request builder, use the `execute()` method to trigger the request. */ postEntity: (pathParam: string, queryParameters?: { queryParam?: string }) => - new OpenApiRequestBuilder('post', '/entities/{pathParam}', { - pathParameters: { pathParam }, - queryParameters - }), + new OpenApiRequestBuilder( + 'post', + '/entities/{pathParam}', + { + pathParameters: { pathParam }, + queryParameters + }, + DefaultApi._defaultBasePath + ), /** * Create a request builder for execution of patch requests to the '/entities/{pathParam}' endpoint. * @param pathParam - Path parameter. @@ -28,8 +34,13 @@ export const DefaultApi = { * @returns The request builder, use the `execute()` method to trigger the request. */ patchEntity: (pathParam: string, body: TestEntity | undefined) => - new OpenApiRequestBuilder('patch', '/entities/{pathParam}', { - pathParameters: { pathParam }, - body - }) + new OpenApiRequestBuilder( + 'patch', + '/entities/{pathParam}', + { + pathParameters: { pathParam }, + body + }, + DefaultApi._defaultBasePath + ) }; diff --git a/test-packages/test-services-openapi/test-service/default-api.js b/test-packages/test-services-openapi/test-service/default-api.js index 9d561ddcda..075d992323 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js +++ b/test-packages/test-services-openapi/test-service/default-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.DefaultApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/default-api.js.map b/test-packages/test-services-openapi/test-service/default-api.js.map index 967aa68f76..b3ed018c13 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js.map +++ b/test-packages/test-services-openapi/test-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;IACH;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;IACH;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/default-api.ts b/test-packages/test-services-openapi/test-service/default-api.ts index 06090b5590..cb6b31e078 100644 --- a/test-packages/test-services-openapi/test-service/default-api.ts +++ b/test-packages/test-services-openapi/test-service/default-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const DefaultApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/entity-api.js b/test-packages/test-services-openapi/test-service/entity-api.js index 8a02c86be2..6cfc6bd9a4 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js +++ b/test-packages/test-services-openapi/test-service/entity-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.EntityApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Get all entities * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. diff --git a/test-packages/test-services-openapi/test-service/entity-api.js.map b/test-packages/test-services-openapi/test-service/entity-api.js.map index 757d74ec66..0b951350a7 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js.map +++ b/test-packages/test-services-openapi/test-service/entity-api.js.map @@ -1 +1 @@ -{"version":3,"file":"entity-api.js","sourceRoot":"","sources":["entity-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,uBAAuB;IACzC;;;;OAIG;IACH,cAAc,EAAE,CAAC,eAShB,EAAE,EAAE,CACH,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,eAAe;KAChB,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC7C,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAqC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,OAAO,EACP,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA0B,EAAE,EAAE,CAC3C,IAAI,+BAAqB,CACvB,QAAQ,EACR,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CACnC,IAAI,+BAAqB,CACvB,KAAK,EACL,sBAAsB,EACtB;QACE,cAAc,EAAE,EAAE,QAAQ,EAAE;KAC7B,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,+BAAqB,CACvB,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"entity-api.js","sourceRoot":"","sources":["entity-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,EAAE;IACpB;;;;OAIG;IACH,cAAc,EAAE,CAAC,eAShB,EAAE,EAAE,CACH,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,eAAe;KAChB,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC7C,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAqC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,OAAO,EACP,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA0B,EAAE,EAAE,CAC3C,IAAI,+BAAqB,CACvB,QAAQ,EACR,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CACnC,IAAI,+BAAqB,CACvB,KAAK,EACL,sBAAsB,EACtB;QACE,cAAc,EAAE,EAAE,QAAQ,EAAE;KAC7B,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,+BAAqB,CACvB,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/entity-api.ts b/test-packages/test-services-openapi/test-service/entity-api.ts index b7c6ff8ddb..4c5528f070 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.ts @@ -10,7 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'test-service' service. */ export const EntityApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Get all entities * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. diff --git a/test-packages/test-services-openapi/test-service/extension-api.js b/test-packages/test-services-openapi/test-service/extension-api.js index 772a77b348..47dd295f0b 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js +++ b/test-packages/test-services-openapi/test-service/extension-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.ExtensionApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/extension-api.js.map b/test-packages/test-services-openapi/test-service/extension-api.js.map index ceb448b71e..466953b1cc 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js.map +++ b/test-packages/test-services-openapi/test-service/extension-api.js.map @@ -1 +1 @@ -{"version":3,"file":"extension-api.js","sourceRoot":"","sources":["extension-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE,CACpB,IAAI,+BAAqB,CACvB,KAAK,EACL,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;IACH;;;OAGG;IACH,gBAAgB,EAAE,GAAG,EAAE,CACrB,IAAI,+BAAqB,CACvB,MAAM,EACN,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"extension-api.js","sourceRoot":"","sources":["extension-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE,CACpB,IAAI,+BAAqB,CACvB,KAAK,EACL,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;IACH;;;OAGG;IACH,gBAAgB,EAAE,GAAG,EAAE,CACrB,IAAI,+BAAqB,CACvB,MAAM,EACN,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/extension-api.ts b/test-packages/test-services-openapi/test-service/extension-api.ts index ad8e75d7b6..dd0eb66d1b 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const ExtensionApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js b/test-packages/test-services-openapi/test-service/tag-dot-api.js index d300a8a85f..17c93958b5 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TagDotApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js.map b/test-packages/test-services-openapi/test-service/tag-dot-api.js.map index 61b7653c24..28cfca8b82 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js.map +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js.map @@ -1 +1 @@ -{"version":3,"file":"tag-dot-api.js","sourceRoot":"","sources":["tag-dot-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"tag-dot-api.js","sourceRoot":"","sources":["tag-dot-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.ts index aa549e7465..2d64f86999 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const TagDotApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js b/test-packages/test-services-openapi/test-service/tag-space-api.js index 45c655ac10..c1127961ca 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TagSpaceApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js.map b/test-packages/test-services-openapi/test-service/tag-space-api.js.map index e12f45e314..12072fc1ce 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js.map +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js.map @@ -1 +1 @@ -{"version":3,"file":"tag-space-api.js","sourceRoot":"","sources":["tag-space-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"tag-space-api.js","sourceRoot":"","sources":["tag-space-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.ts b/test-packages/test-services-openapi/test-service/tag-space-api.ts index 65c38de932..e0e5b8a9af 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const TagSpaceApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js b/test-packages/test-services-openapi/test-service/test-case-api.js index b16f090ef3..2d6cb44538 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js +++ b/test-packages/test-services-openapi/test-service/test-case-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TestCaseApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js.map b/test-packages/test-services-openapi/test-service/test-case-api.js.map index fc5b33a818..774d49fb4e 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js.map +++ b/test-packages/test-services-openapi/test-service/test-case-api.js.map @@ -1 +1 @@ -{"version":3,"file":"test-case-api.js","sourceRoot":"","sources":["test-case-api.ts"],"names":[],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"test-case-api.js","sourceRoot":"","sources":["test-case-api.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/test-case-api.ts b/test-packages/test-services-openapi/test-service/test-case-api.ts index f29f589339..94214f68ad 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.ts @@ -15,7 +15,7 @@ import type { * This API is part of the 'test-service' service. */ export const TestCaseApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: '', /** * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. diff --git a/test-resources/openapi-service-specs/options-per-service.json b/test-resources/openapi-service-specs/options-per-service.json deleted file mode 100644 index 7aa214b4bf..0000000000 --- a/test-resources/openapi-service-specs/options-per-service.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "../../test-resources/openapi-service-specs/test-service.json": { - "packageName": "test-service", - "directoryName": "test-service", - "basePath": "/base/path/to/service" - } -} From 90fcb7811b37dcf6fb601aa3e77e881527b122ac Mon Sep 17 00:00:00 2001 From: cloud-sdk-js Date: Mon, 9 Dec 2024 10:18:44 +0000 Subject: [PATCH 19/59] Changes from lint:fix --- .../test-services-openapi/generate-openapi-services.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test-packages/test-services-openapi/generate-openapi-services.ts b/test-packages/test-services-openapi/generate-openapi-services.ts index 0fccaec126..011beedbfc 100644 --- a/test-packages/test-services-openapi/generate-openapi-services.ts +++ b/test-packages/test-services-openapi/generate-openapi-services.ts @@ -16,12 +16,7 @@ const generatorConfigOpenApi: Partial = { async function generateOpenApi() { await generate({ ...generatorConfigOpenApi, - input: resolve( - '..', - '..', - 'test-resources', - 'openapi-service-specs' - ), + input: resolve('..', '..', 'test-resources', 'openapi-service-specs'), outputDir: resolve('.'), transpile: true }).catch(reason => { @@ -30,4 +25,4 @@ async function generateOpenApi() { }); } -generateOpenApi(); \ No newline at end of file +generateOpenApi(); From bd78a6ae0277a4f653d3da697e5bcec7f8d0f8f2 Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 13:02:59 +0100 Subject: [PATCH 20/59] chore: cleanup path --- .../test-services-openapi/generate-openapi-services.ts | 2 +- .../openapi-service-specs/config/options-per-service.json | 7 +++++++ .../{ => specifications}/no-schema-service.yml | 0 .../{ => specifications}/swagger-yaml-service.yml | 0 .../{ => specifications}/test-service.json | 0 5 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test-resources/openapi-service-specs/config/options-per-service.json rename test-resources/openapi-service-specs/{ => specifications}/no-schema-service.yml (100%) rename test-resources/openapi-service-specs/{ => specifications}/swagger-yaml-service.yml (100%) rename test-resources/openapi-service-specs/{ => specifications}/test-service.json (100%) diff --git a/test-packages/test-services-openapi/generate-openapi-services.ts b/test-packages/test-services-openapi/generate-openapi-services.ts index 011beedbfc..49532ce2f3 100644 --- a/test-packages/test-services-openapi/generate-openapi-services.ts +++ b/test-packages/test-services-openapi/generate-openapi-services.ts @@ -16,7 +16,7 @@ const generatorConfigOpenApi: Partial = { async function generateOpenApi() { await generate({ ...generatorConfigOpenApi, - input: resolve('..', '..', 'test-resources', 'openapi-service-specs'), + input: resolve('..', '..', 'test-resources', 'openapi-service-specs','specifications'), outputDir: resolve('.'), transpile: true }).catch(reason => { diff --git a/test-resources/openapi-service-specs/config/options-per-service.json b/test-resources/openapi-service-specs/config/options-per-service.json new file mode 100644 index 0000000000..088402b79e --- /dev/null +++ b/test-resources/openapi-service-specs/config/options-per-service.json @@ -0,0 +1,7 @@ +{ + "../../test-resources/openapi-service-specs/no-schema-service.yml": { + "packageName": "no-schema-service", + "directoryName": "no-schema-service", + "basePath": "/base/path/to/service" + } +} diff --git a/test-resources/openapi-service-specs/no-schema-service.yml b/test-resources/openapi-service-specs/specifications/no-schema-service.yml similarity index 100% rename from test-resources/openapi-service-specs/no-schema-service.yml rename to test-resources/openapi-service-specs/specifications/no-schema-service.yml diff --git a/test-resources/openapi-service-specs/swagger-yaml-service.yml b/test-resources/openapi-service-specs/specifications/swagger-yaml-service.yml similarity index 100% rename from test-resources/openapi-service-specs/swagger-yaml-service.yml rename to test-resources/openapi-service-specs/specifications/swagger-yaml-service.yml diff --git a/test-resources/openapi-service-specs/test-service.json b/test-resources/openapi-service-specs/specifications/test-service.json similarity index 100% rename from test-resources/openapi-service-specs/test-service.json rename to test-resources/openapi-service-specs/specifications/test-service.json From 82a1a519d077d11257d5161723c9ac2f50631417 Mon Sep 17 00:00:00 2001 From: cloud-sdk-js Date: Mon, 9 Dec 2024 12:06:22 +0000 Subject: [PATCH 21/59] Changes from lint:fix --- .../test-services-openapi/generate-openapi-services.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test-packages/test-services-openapi/generate-openapi-services.ts b/test-packages/test-services-openapi/generate-openapi-services.ts index 49532ce2f3..9481addf93 100644 --- a/test-packages/test-services-openapi/generate-openapi-services.ts +++ b/test-packages/test-services-openapi/generate-openapi-services.ts @@ -16,7 +16,13 @@ const generatorConfigOpenApi: Partial = { async function generateOpenApi() { await generate({ ...generatorConfigOpenApi, - input: resolve('..', '..', 'test-resources', 'openapi-service-specs','specifications'), + input: resolve( + '..', + '..', + 'test-resources', + 'openapi-service-specs', + 'specifications' + ), outputDir: resolve('.'), transpile: true }).catch(reason => { From 4a0822b0b7de18f0d2ff1af5c44d9f336fbf1263 Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 13:23:27 +0100 Subject: [PATCH 22/59] chore: adjust test --- .../test-services-openapi/generate-openapi-services.ts | 3 ++- .../no-schema-service/default-api.js | 2 +- .../no-schema-service/default-api.js.map | 2 +- .../no-schema-service/default-api.ts | 2 +- .../config/options-per-service.json | 10 +++++++++- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/test-packages/test-services-openapi/generate-openapi-services.ts b/test-packages/test-services-openapi/generate-openapi-services.ts index 49532ce2f3..4b373b9899 100644 --- a/test-packages/test-services-openapi/generate-openapi-services.ts +++ b/test-packages/test-services-openapi/generate-openapi-services.ts @@ -18,7 +18,8 @@ async function generateOpenApi() { ...generatorConfigOpenApi, input: resolve('..', '..', 'test-resources', 'openapi-service-specs','specifications'), outputDir: resolve('.'), - transpile: true + transpile: true, + optionsPerService: resolve('..', '..', 'test-resources', 'openapi-service-specs','config') }).catch(reason => { logger.error(`Unhandled rejection at: ${reason}`); process.exit(1); diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.js b/test-packages/test-services-openapi/no-schema-service/default-api.js index 18925e6009..b576ab1813 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.js +++ b/test-packages/test-services-openapi/no-schema-service/default-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'no-schema-service' service. */ exports.DefaultApi = { - _defaultBasePath: '', + _defaultBasePath: '/base/path/to/service', /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.js.map b/test-packages/test-services-openapi/no-schema-service/default-api.js.map index 7c1290e2d1..bc2271cfd7 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.js.map +++ b/test-packages/test-services-openapi/no-schema-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,GAAG,EAAE,GAAG,EAAE,CACR,IAAI,+BAAqB,CAAM,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAU,CAAC,gBAAgB,CAAC;CAC9E,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,GAAG,EAAE,GAAG,EAAE,CACR,IAAI,+BAAqB,CAAM,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAU,CAAC,gBAAgB,CAAC;CAC9E,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.ts b/test-packages/test-services-openapi/no-schema-service/default-api.ts index 613f18b524..c52dc2a013 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.ts +++ b/test-packages/test-services-openapi/no-schema-service/default-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'no-schema-service' service. */ export const DefaultApi = { - _defaultBasePath: '', + _defaultBasePath: '/base/path/to/service', /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-resources/openapi-service-specs/config/options-per-service.json b/test-resources/openapi-service-specs/config/options-per-service.json index 088402b79e..41ea3d7ac2 100644 --- a/test-resources/openapi-service-specs/config/options-per-service.json +++ b/test-resources/openapi-service-specs/config/options-per-service.json @@ -1,7 +1,15 @@ { - "../../test-resources/openapi-service-specs/no-schema-service.yml": { + "../../test-resources/openapi-service-specs/specifications/no-schema-service.yml": { "packageName": "no-schema-service", "directoryName": "no-schema-service", "basePath": "/base/path/to/service" + }, + "../../test-resources/openapi-service-specs/specifications/swagger-yaml-service.yml": { + "packageName": "swagger-yaml-service", + "directoryName": "swagger-yaml-service" + }, + "../../test-resources/openapi-service-specs/specifications/test-service.json": { + "packageName": "test-service", + "directoryName": "test-service" } } From 52ca4485717acf515498751b488bf804be51ff2c Mon Sep 17 00:00:00 2001 From: cloud-sdk-js Date: Mon, 9 Dec 2024 12:48:02 +0000 Subject: [PATCH 23/59] Changes from lint:fix --- .../test-services-openapi/generate-openapi-services.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test-packages/test-services-openapi/generate-openapi-services.ts b/test-packages/test-services-openapi/generate-openapi-services.ts index f68f50e91b..24049fdfc7 100644 --- a/test-packages/test-services-openapi/generate-openapi-services.ts +++ b/test-packages/test-services-openapi/generate-openapi-services.ts @@ -25,7 +25,13 @@ async function generateOpenApi() { ), outputDir: resolve('.'), transpile: true, - optionsPerService: resolve('..', '..', 'test-resources', 'openapi-service-specs','config') + optionsPerService: resolve( + '..', + '..', + 'test-resources', + 'openapi-service-specs', + 'config' + ) }).catch(reason => { logger.error(`Unhandled rejection at: ${reason}`); process.exit(1); From e66bf025700bfd7e857a3cad32d214e5c6023f3a Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 14:28:43 +0100 Subject: [PATCH 24/59] chore: switch to using undefined for default basePath value --- .../file-serializer/__snapshots__/api-file.spec.ts.snap | 8 ++++---- .../openapi-generator/src/file-serializer/api-file.ts | 3 ++- .../openapi-generator/src/file-serializer/operation.ts | 1 - packages/openapi/src/openapi-request-builder.ts | 9 +++++---- .../swagger-yaml-service/default-api.d.ts | 2 +- .../swagger-yaml-service/default-api.js | 2 +- .../swagger-yaml-service/default-api.js.map | 2 +- .../swagger-yaml-service/default-api.ts | 2 +- .../test-services-openapi/test-service/default-api.d.ts | 2 +- .../test-services-openapi/test-service/default-api.js | 2 +- .../test-service/default-api.js.map | 2 +- .../test-services-openapi/test-service/default-api.ts | 2 +- .../test-services-openapi/test-service/entity-api.d.ts | 2 +- .../test-services-openapi/test-service/entity-api.js | 2 +- .../test-services-openapi/test-service/entity-api.js.map | 2 +- .../test-services-openapi/test-service/entity-api.ts | 2 +- .../test-service/extension-api.d.ts | 2 +- .../test-services-openapi/test-service/extension-api.js | 2 +- .../test-service/extension-api.js.map | 2 +- .../test-services-openapi/test-service/extension-api.ts | 2 +- .../test-services-openapi/test-service/tag-dot-api.d.ts | 2 +- .../test-services-openapi/test-service/tag-dot-api.js | 2 +- .../test-service/tag-dot-api.js.map | 2 +- .../test-services-openapi/test-service/tag-dot-api.ts | 2 +- .../test-service/tag-space-api.d.ts | 2 +- .../test-services-openapi/test-service/tag-space-api.js | 2 +- .../test-service/tag-space-api.js.map | 2 +- .../test-services-openapi/test-service/tag-space-api.ts | 2 +- .../test-service/test-case-api.d.ts | 2 +- .../test-services-openapi/test-service/test-case-api.js | 2 +- .../test-service/test-case-api.js.map | 2 +- .../test-services-openapi/test-service/test-case-api.ts | 2 +- 32 files changed, 39 insertions(+), 38 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap index e960a98064..9c0699e9a5 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap @@ -8,7 +8,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema/index.j * This API is part of the 'MyServiceName' service. */ export const TestApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. @@ -49,7 +49,7 @@ exports[`api-file creates an api file with documentation 1`] = ` * This API is part of the 'TestService' service. */ export const TestApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the 'test' endpoint. * @returns The request builder, use the \`execute()\` method to trigger the request. @@ -78,7 +78,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; * This API is part of the 'MyServiceName' service. */ export const TestApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. @@ -161,7 +161,7 @@ exports[`api-file serializes api file with one operation and no references 1`] = * This API is part of the 'MyServiceName' service. */ export const TestApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index 6bc30fcb74..cbd03e3208 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -35,10 +35,11 @@ export function apiFile( const imports = serializeImports(getImports(api, options)); const apiDoc = apiDocumentation(api, serviceName); const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; + // Add a leading slash if basePath is not empty, as all Path Items start with a slash according to Swagger 3 const defaultBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; const apiContent = codeBlock` export const ${api.name} = { - _defaultBasePath: '${defaultBasePath}', + _defaultBasePath: ${defaultBasePath ? `'${defaultBasePath}'` : undefined}, ${api.operations.map(operation => serializeOperation(operation, api.name)).join(',\n')} }; `; diff --git a/packages/openapi-generator/src/file-serializer/operation.ts b/packages/openapi-generator/src/file-serializer/operation.ts index da7a64fa33..6a007a9a9d 100644 --- a/packages/openapi-generator/src/file-serializer/operation.ts +++ b/packages/openapi-generator/src/file-serializer/operation.ts @@ -26,7 +26,6 @@ export function serializeOperation( if (bodyAndQueryParams) { requestBuilderParams.push(bodyAndQueryParams); } else { - // to keep the order of the params correct while adding the base path requestBuilderParams.push('{}'); } diff --git a/packages/openapi/src/openapi-request-builder.ts b/packages/openapi/src/openapi-request-builder.ts index 39d8313783..b62493d20c 100644 --- a/packages/openapi/src/openapi-request-builder.ts +++ b/packages/openapi/src/openapi-request-builder.ts @@ -46,7 +46,7 @@ export class OpenApiRequestBuilder { public method: Method, private pathPattern: string, private parameters?: OpenApiRequestParameters, - private basePath?: string + private basePath?: string | undefined ) {} /** @@ -147,9 +147,10 @@ export class OpenApiRequestBuilder { * @returns The request builder itself, to facilitate method chaining. */ setBasePath(basePath: string): this { - const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; - const fixedBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; - this.basePath = fixedBasePath; + let sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; + // Add a leading slash if basePath is not empty, as all Path Items start with a slash according to Swagger 3 + sanitizedBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; + this.basePath = sanitizedBasePath; return this; } diff --git a/test-packages/test-services-openapi/swagger-yaml-service/default-api.d.ts b/test-packages/test-services-openapi/swagger-yaml-service/default-api.d.ts index 1d362af3e1..ca7f555a75 100644 --- a/test-packages/test-services-openapi/swagger-yaml-service/default-api.d.ts +++ b/test-packages/test-services-openapi/swagger-yaml-service/default-api.d.ts @@ -10,7 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'swagger-yaml-service' service. */ export declare const DefaultApi: { - _defaultBasePath: string; + _defaultBasePath: undefined; /** * Test POST * @param pathParam - Path parameter. diff --git a/test-packages/test-services-openapi/swagger-yaml-service/default-api.js b/test-packages/test-services-openapi/swagger-yaml-service/default-api.js index a8691ee19f..4c01443dbf 100644 --- a/test-packages/test-services-openapi/swagger-yaml-service/default-api.js +++ b/test-packages/test-services-openapi/swagger-yaml-service/default-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'swagger-yaml-service' service. */ exports.DefaultApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Test POST * @param pathParam - Path parameter. diff --git a/test-packages/test-services-openapi/swagger-yaml-service/default-api.js.map b/test-packages/test-services-openapi/swagger-yaml-service/default-api.js.map index 07cb8a1ea8..029c4321ef 100644 --- a/test-packages/test-services-openapi/swagger-yaml-service/default-api.js.map +++ b/test-packages/test-services-openapi/swagger-yaml-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,EAAE;IACpB;;;;;OAKG;IACH,UAAU,EAAE,CAAC,SAAiB,EAAE,eAAyC,EAAE,EAAE,CAC3E,IAAI,+BAAqB,CACvB,MAAM,EACN,uBAAuB,EACvB;QACE,cAAc,EAAE,EAAE,SAAS,EAAE;QAC7B,eAAe;KAChB,EACD,kBAAU,CAAC,gBAAgB,CAC5B;IACH;;;;;OAKG;IACH,WAAW,EAAE,CAAC,SAAiB,EAAE,IAA4B,EAAE,EAAE,CAC/D,IAAI,+BAAqB,CACvB,OAAO,EACP,uBAAuB,EACvB;QACE,cAAc,EAAE,EAAE,SAAS,EAAE;QAC7B,IAAI;KACL,EACD,kBAAU,CAAC,gBAAgB,CAC5B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,SAAS;IAC3B;;;;;OAKG;IACH,UAAU,EAAE,CAAC,SAAiB,EAAE,eAAyC,EAAE,EAAE,CAC3E,IAAI,+BAAqB,CACvB,MAAM,EACN,uBAAuB,EACvB;QACE,cAAc,EAAE,EAAE,SAAS,EAAE;QAC7B,eAAe;KAChB,EACD,kBAAU,CAAC,gBAAgB,CAC5B;IACH;;;;;OAKG;IACH,WAAW,EAAE,CAAC,SAAiB,EAAE,IAA4B,EAAE,EAAE,CAC/D,IAAI,+BAAqB,CACvB,OAAO,EACP,uBAAuB,EACvB;QACE,cAAc,EAAE,EAAE,SAAS,EAAE;QAC7B,IAAI;KACL,EACD,kBAAU,CAAC,gBAAgB,CAC5B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/swagger-yaml-service/default-api.ts b/test-packages/test-services-openapi/swagger-yaml-service/default-api.ts index c097213023..096a59b320 100644 --- a/test-packages/test-services-openapi/swagger-yaml-service/default-api.ts +++ b/test-packages/test-services-openapi/swagger-yaml-service/default-api.ts @@ -10,7 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'swagger-yaml-service' service. */ export const DefaultApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Test POST * @param pathParam - Path parameter. diff --git a/test-packages/test-services-openapi/test-service/default-api.d.ts b/test-packages/test-services-openapi/test-service/default-api.d.ts index 23afbe58a4..88b1bf72c4 100644 --- a/test-packages/test-services-openapi/test-service/default-api.d.ts +++ b/test-packages/test-services-openapi/test-service/default-api.d.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export declare const DefaultApi: { - _defaultBasePath: string; + _defaultBasePath: undefined; /** * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/default-api.js b/test-packages/test-services-openapi/test-service/default-api.js index 075d992323..e43acb0ecd 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js +++ b/test-packages/test-services-openapi/test-service/default-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.DefaultApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/default-api.js.map b/test-packages/test-services-openapi/test-service/default-api.js.map index b3ed018c13..bbe408f866 100644 --- a/test-packages/test-services-openapi/test-service/default-api.js.map +++ b/test-packages/test-services-openapi/test-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;IACH;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,SAAS;IAC3B;;;OAGG;IACH,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;IACH;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,kBAAU,CAAC,gBAAgB,CAC5B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/default-api.ts b/test-packages/test-services-openapi/test-service/default-api.ts index cb6b31e078..4e54755238 100644 --- a/test-packages/test-services-openapi/test-service/default-api.ts +++ b/test-packages/test-services-openapi/test-service/default-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const DefaultApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the '/test-cases/default-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/entity-api.d.ts b/test-packages/test-services-openapi/test-service/entity-api.d.ts index cecb1e4769..b79d011129 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.d.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.d.ts @@ -10,7 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'test-service' service. */ export declare const EntityApi: { - _defaultBasePath: string; + _defaultBasePath: undefined; /** * Get all entities * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. diff --git a/test-packages/test-services-openapi/test-service/entity-api.js b/test-packages/test-services-openapi/test-service/entity-api.js index 6cfc6bd9a4..c7aed72a90 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js +++ b/test-packages/test-services-openapi/test-service/entity-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.EntityApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Get all entities * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. diff --git a/test-packages/test-services-openapi/test-service/entity-api.js.map b/test-packages/test-services-openapi/test-service/entity-api.js.map index 0b951350a7..3be29a091b 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.js.map +++ b/test-packages/test-services-openapi/test-service/entity-api.js.map @@ -1 +1 @@ -{"version":3,"file":"entity-api.js","sourceRoot":"","sources":["entity-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,EAAE;IACpB;;;;OAIG;IACH,cAAc,EAAE,CAAC,eAShB,EAAE,EAAE,CACH,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,eAAe;KAChB,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC7C,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAqC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,OAAO,EACP,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA0B,EAAE,EAAE,CAC3C,IAAI,+BAAqB,CACvB,QAAQ,EACR,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CACnC,IAAI,+BAAqB,CACvB,KAAK,EACL,sBAAsB,EACtB;QACE,cAAc,EAAE,EAAE,QAAQ,EAAE;KAC7B,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,+BAAqB,CACvB,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"entity-api.js","sourceRoot":"","sources":["entity-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAE/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,SAAS;IAC3B;;;;OAIG;IACH,cAAc,EAAE,CAAC,eAShB,EAAE,EAAE,CACH,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,eAAe;KAChB,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,mBAAmB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,KAAK,EACL,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA4B,EAAE,EAAE,CAC7C,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAqC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,OAAO,EACP,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAA0B,EAAE,EAAE,CAC3C,IAAI,+BAAqB,CACvB,QAAQ,EACR,WAAW,EACX;QACE,IAAI;KACL,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,WAAW,EACX,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;;OAIG;IACH,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE,CACnC,IAAI,+BAAqB,CACvB,KAAK,EACL,sBAAsB,EACtB;QACE,cAAc,EAAE,EAAE,QAAQ,EAAE;KAC7B,EACD,iBAAS,CAAC,gBAAgB,CAC3B;IACH;;;OAGG;IACH,aAAa,EAAE,GAAG,EAAE,CAClB,IAAI,+BAAqB,CACvB,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/entity-api.ts b/test-packages/test-services-openapi/test-service/entity-api.ts index 4c5528f070..d1ea284743 100644 --- a/test-packages/test-services-openapi/test-service/entity-api.ts +++ b/test-packages/test-services-openapi/test-service/entity-api.ts @@ -10,7 +10,7 @@ import type { TestEntity } from './schema'; * This API is part of the 'test-service' service. */ export const EntityApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Get all entities * @param queryParameters - Object containing the following keys: stringParameter, integerParameter, $dollarParameter, dot.parameter, enumStringParameter, enumInt32Parameter, enumDoubleParameter, enumBooleanParameter. diff --git a/test-packages/test-services-openapi/test-service/extension-api.d.ts b/test-packages/test-services-openapi/test-service/extension-api.d.ts index 354c6b5495..043985d7a0 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.d.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.d.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export declare const ExtensionApi: { - _defaultBasePath: string; + _defaultBasePath: undefined; /** * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/extension-api.js b/test-packages/test-services-openapi/test-service/extension-api.js index 47dd295f0b..6bc3ef9515 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js +++ b/test-packages/test-services-openapi/test-service/extension-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.ExtensionApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/extension-api.js.map b/test-packages/test-services-openapi/test-service/extension-api.js.map index 466953b1cc..a6f5901367 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.js.map +++ b/test-packages/test-services-openapi/test-service/extension-api.js.map @@ -1 +1 @@ -{"version":3,"file":"extension-api.js","sourceRoot":"","sources":["extension-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE,CACpB,IAAI,+BAAqB,CACvB,KAAK,EACL,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;IACH;;;OAGG;IACH,gBAAgB,EAAE,GAAG,EAAE,CACrB,IAAI,+BAAqB,CACvB,MAAM,EACN,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"extension-api.js","sourceRoot":"","sources":["extension-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,YAAY,GAAG;IAC1B,gBAAgB,EAAE,SAAS;IAC3B;;;OAGG;IACH,eAAe,EAAE,GAAG,EAAE,CACpB,IAAI,+BAAqB,CACvB,KAAK,EACL,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;IACH;;;OAGG;IACH,gBAAgB,EAAE,GAAG,EAAE,CACrB,IAAI,+BAAqB,CACvB,MAAM,EACN,uBAAuB,EACvB,EAAE,EACF,oBAAY,CAAC,gBAAgB,CAC9B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/extension-api.ts b/test-packages/test-services-openapi/test-service/extension-api.ts index dd0eb66d1b..ef6d99a045 100644 --- a/test-packages/test-services-openapi/test-service/extension-api.ts +++ b/test-packages/test-services-openapi/test-service/extension-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const ExtensionApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the '/test-cases/extension' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts index f7b07b35b9..781df0fab4 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.d.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export declare const TagDotApi: { - _defaultBasePath: string; + _defaultBasePath: undefined; /** * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js b/test-packages/test-services-openapi/test-service/tag-dot-api.js index 17c93958b5..e67fb72de2 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TagDotApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.js.map b/test-packages/test-services-openapi/test-service/tag-dot-api.js.map index 28cfca8b82..66e8f73cb3 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.js.map +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.js.map @@ -1 +1 @@ -{"version":3,"file":"tag-dot-api.js","sourceRoot":"","sources":["tag-dot-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"tag-dot-api.js","sourceRoot":"","sources":["tag-dot-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,gBAAgB,EAAE,SAAS;IAC3B;;;OAGG;IACH,UAAU,EAAE,GAAG,EAAE,CACf,IAAI,+BAAqB,CACvB,KAAK,EACL,yBAAyB,EACzB,EAAE,EACF,iBAAS,CAAC,gBAAgB,CAC3B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-dot-api.ts b/test-packages/test-services-openapi/test-service/tag-dot-api.ts index 2d64f86999..fdfacda288 100644 --- a/test-packages/test-services-openapi/test-service/tag-dot-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-dot-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const TagDotApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.d.ts b/test-packages/test-services-openapi/test-service/tag-space-api.d.ts index ab682d8d0f..ba4224c07f 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.d.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.d.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export declare const TagSpaceApi: { - _defaultBasePath: string; + _defaultBasePath: undefined; /** * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js b/test-packages/test-services-openapi/test-service/tag-space-api.js index c1127961ca..48efb3f7a1 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TagSpaceApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.js.map b/test-packages/test-services-openapi/test-service/tag-space-api.js.map index 12072fc1ce..b1599ae72b 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.js.map +++ b/test-packages/test-services-openapi/test-service/tag-space-api.js.map @@ -1 +1 @@ -{"version":3,"file":"tag-space-api.js","sourceRoot":"","sources":["tag-space-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,gBAAgB,EAAE,EAAE;IACpB;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"tag-space-api.js","sourceRoot":"","sources":["tag-space-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,gBAAgB,EAAE,SAAS;IAC3B;;;OAGG;IACH,YAAY,EAAE,GAAG,EAAE,CACjB,IAAI,+BAAqB,CACvB,MAAM,EACN,yBAAyB,EACzB,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;CACJ,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/tag-space-api.ts b/test-packages/test-services-openapi/test-service/tag-space-api.ts index e0e5b8a9af..a367e19128 100644 --- a/test-packages/test-services-openapi/test-service/tag-space-api.ts +++ b/test-packages/test-services-openapi/test-service/tag-space-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'test-service' service. */ export const TagSpaceApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of post requests to the '/test-cases/special-tag' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/test-service/test-case-api.d.ts b/test-packages/test-services-openapi/test-service/test-case-api.d.ts index 9384c7d86f..d94576383a 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.d.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.d.ts @@ -15,7 +15,7 @@ import type { * This API is part of the 'test-service' service. */ export declare const TestCaseApi: { - _defaultBasePath: string; + _defaultBasePath: undefined; /** * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js b/test-packages/test-services-openapi/test-service/test-case-api.js index 2d6cb44538..9f7df71708 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js +++ b/test-packages/test-services-openapi/test-service/test-case-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'test-service' service. */ exports.TestCaseApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. diff --git a/test-packages/test-services-openapi/test-service/test-case-api.js.map b/test-packages/test-services-openapi/test-service/test-case-api.js.map index 774d49fb4e..80a212b474 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.js.map +++ b/test-packages/test-services-openapi/test-service/test-case-api.js.map @@ -1 +1 @@ -{"version":3,"file":"test-case-api.js","sourceRoot":"","sources":["test-case-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAO/D;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,gBAAgB,EAAE,EAAE;IACpB;;;;;;OAMG;IACH,6BAA6B,EAAE,CAC7B,yBAAiC,EACjC,IAAkC,EAClC,eAKC,EACD,EAAE,CACF,IAAI,+BAAqB,CACvB,KAAK,EACL,wEAAwE,EACxE;QACE,cAAc,EAAE,EAAE,yBAAyB,EAAE;QAC7C,IAAI;QACJ,eAAe;KAChB,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;;;OAMG;IACH,8BAA8B,EAAE,CAC9B,yBAAiC,EACjC,IAAsB,EACtB,eAKC,EACD,EAAE,CACF,IAAI,+BAAqB,CACvB,MAAM,EACN,wEAAwE,EACxE;QACE,cAAc,EAAE,EAAE,yBAAyB,EAAE;QAC7C,IAAI;QACJ,eAAe;KAChB,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;;OAKG;IACH,mCAAmC,EAAE,CACnC,eAA+C,EAC/C,gBAAmD,EACnD,EAAE,CACF,IAAI,+BAAqB,CACvB,KAAK,EACL,wBAAwB,EACxB;QACE,eAAe;QACf,gBAAgB;KACjB,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;;;OAMG;IACH,mCAAmC,EAAE,CACnC,IAAsB,EACtB,eAAgD,EAChD,gBAAiD,EACjD,EAAE,CACF,IAAI,+BAAqB,CACvB,MAAM,EACN,wBAAwB,EACxB;QACE,IAAI;QACJ,eAAe;QACf,gBAAgB;KACjB,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;;;OAMG;IACH,mCAAmC,EAAE,CACnC,IAAsB,EACtB,eAAiD,EACjD,gBAAmD,EACnD,EAAE,CACF,IAAI,+BAAqB,CACvB,OAAO,EACP,wBAAwB,EACxB;QACE,IAAI;QACJ,eAAe;QACf,gBAAgB;KACjB,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;;OAKG;IACH,8BAA8B,EAAE,CAC9B,cAAsB,EACtB,eAA2C,EAC3C,EAAE,CACF,IAAI,+BAAqB,CACvB,KAAK,EACL,yCAAyC,EACzC;QACE,cAAc,EAAE,EAAE,cAAc,EAAE;QAClC,eAAe;KAChB,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;OAGG;IACH,oBAAoB,EAAE,GAAG,EAAE,CACzB,IAAI,+BAAqB,CACvB,KAAK,EACL,qCAAqC,EACrC,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;OAGG;IACH,uBAAuB,EAAE,GAAG,EAAE,CAC5B,IAAI,+BAAqB,CACvB,KAAK,EACL,qCAAqC,EACrC,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;OAGG;IACH,sBAAsB,EAAE,GAAG,EAAE,CAC3B,IAAI,+BAAqB,CACvB,MAAM,EACN,qCAAqC,EACrC,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;OAGG;IACH,qBAAqB,EAAE,GAAG,EAAE,CAC1B,IAAI,+BAAqB,CACvB,OAAO,EACP,qCAAqC,EACrC,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;;OAKG;IACH,MAAM,EAAE,CAAC,MAAc,EAAE,eAAkC,EAAE,EAAE,CAC7D,IAAI,+BAAqB,CACvB,KAAK,EACL,wCAAwC,EACxC;QACE,cAAc,EAAE,EAAE,MAAM,EAAE;QAC1B,eAAe;KAChB,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;OAIG;IACH,cAAc,EAAE,CAAC,IAAmC,EAAE,EAAE,CACtD,IAAI,+BAAqB,CACvB,KAAK,EACL,6BAA6B,EAC7B;QACE,IAAI;KACL,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,IAA6C,EAAE,EAAE,CACpE,IAAI,+BAAqB,CACvB,MAAM,EACN,6BAA6B,EAC7B;QACE,IAAI;KACL,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,IAA8B,EAAE,EAAE,CACpD,IAAI,+BAAqB,CACvB,KAAK,EACL,iCAAiC,EACjC;QACE,IAAI;KACL,EACD,mBAAW,CAAC,gBAAgB,CAC7B;IACH;;;OAGG;IACH,yBAAyB,EAAE,GAAG,EAAE,CAC9B,IAAI,+BAAqB,CACvB,KAAK,EACL,6BAA6B,EAC7B,EAAE,EACF,mBAAW,CAAC,gBAAgB,CAC7B;CACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"test-case-api.js","sourceRoot":"","sources":["test-case-api.ts"],"names":[],"mappings":"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"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/test-service/test-case-api.ts b/test-packages/test-services-openapi/test-service/test-case-api.ts index 94214f68ad..79d7358ea6 100644 --- a/test-packages/test-services-openapi/test-service/test-case-api.ts +++ b/test-packages/test-services-openapi/test-service/test-case-api.ts @@ -15,7 +15,7 @@ import type { * This API is part of the 'test-service' service. */ export const TestCaseApi = { - _defaultBasePath: '', + _defaultBasePath: undefined, /** * Create a request builder for execution of get requests to the '/test-cases/parameters/required-parameters/{requiredPathItemPathParam}' endpoint. * @param requiredPathItemPathParam - Path parameter. From 12326517755417a51ce5b112872383f11b9b423e Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 14:39:26 +0100 Subject: [PATCH 25/59] chore: cleanup test --- .../src/file-serializer/operation.spec.ts | 47 ------------------- .../src/openapi-request-builder.spec.ts | 2 +- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/operation.spec.ts b/packages/openapi-generator/src/file-serializer/operation.spec.ts index 35c76cf7ee..386371bc4e 100644 --- a/packages/openapi-generator/src/file-serializer/operation.spec.ts +++ b/packages/openapi-generator/src/file-serializer/operation.spec.ts @@ -74,53 +74,6 @@ describe('serializeOperation', () => { `); }); - it('serializes operation by appending base path to the path pattern', () => { - const operation: OpenApiOperation = { - operationId: 'getFn', - method: 'get', - tags: [], - pathParameters: [ - { - in: 'path', - name: 'id', - originalName: 'id', - schema: { type: 'string' }, - required: true, - schemaProperties: {} - }, - { - in: 'path', - name: 'subId', - originalName: 'subId', - schema: { type: 'string' }, - required: true, - schemaProperties: {} - } - ], - queryParameters: [], - headerParameters: [], - responses: { 200: { description: 'some response description' } }, - response: { type: 'string' }, - pathPattern: '/test/{id}/{subId}' - }; - expect(serializeOperation(operation, apiName)).toMatchInlineSnapshot(` - "/** - * Create a request builder for execution of get requests to the '/test/{id}/{subId}' endpoint. - * @param id - Path parameter. - * @param subId - Path parameter. - * @returns The request builder, use the \`execute()\` method to trigger the request. - */ - getFn: (id: string, subId: string) => new OpenApiRequestBuilder( - 'get', - "/test/{id}/{subId}", - { - pathParameters: { id, subId } - }, - TestApi._defaultBasePath - )" - `); - }); - it('serializes operation with path and header parameters', () => { const operation: OpenApiOperation = { operationId: 'deleteFn', diff --git a/packages/openapi/src/openapi-request-builder.spec.ts b/packages/openapi/src/openapi-request-builder.spec.ts index 190057fb49..c9e2b74fea 100644 --- a/packages/openapi/src/openapi-request-builder.spec.ts +++ b/packages/openapi/src/openapi-request-builder.spec.ts @@ -80,7 +80,7 @@ describe('openapi-request-builder', () => { const requestBuilder = new OpenApiRequestBuilder( 'get', '/test' - ).setBasePath('/base/path/to/service/'); + ).setBasePath('//base/path/to/service/'); const response = await requestBuilder.executeRaw(destination); expect(httpClient.executeHttpRequest).toHaveBeenCalledWith( sanitizeDestination(destination), From 333c21b9fec8d7af17ee28e52464d3617fb924fb Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 14:57:25 +0100 Subject: [PATCH 26/59] chore: update changeset --- .changeset/chilled-flowers-hide.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.changeset/chilled-flowers-hide.md b/.changeset/chilled-flowers-hide.md index b43c4645ed..3b63fa3064 100644 --- a/.changeset/chilled-flowers-hide.md +++ b/.changeset/chilled-flowers-hide.md @@ -1,6 +1,14 @@ --- '@sap-cloud-sdk/openapi-generator': minor +'@sap-cloud-sdk/openapi': minor '@sap-cloud-sdk/util': minor --- [New Functionality] Support `basePath` in the `options-per-service.json` file in the OpenAPI generator. It enables the base path to be prepended to the path parameter for every request of the generated client. +Introduce `setBasePath()` method on the OpenAPI request builder which allows to set the base path dynamically for every request to the client. + +```typescript +const responseData = await MyApi.myFunction() + .setBasePath('/base/path/to/service') + .execute(destination); +``` From f185dfaafcf561b60b9cf333824cae1b9da53ad0 Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 15:17:34 +0100 Subject: [PATCH 27/59] chore: adjust changeset --- .changeset/chilled-flowers-hide.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.changeset/chilled-flowers-hide.md b/.changeset/chilled-flowers-hide.md index 3b63fa3064..8d5004b2ee 100644 --- a/.changeset/chilled-flowers-hide.md +++ b/.changeset/chilled-flowers-hide.md @@ -6,7 +6,6 @@ [New Functionality] Support `basePath` in the `options-per-service.json` file in the OpenAPI generator. It enables the base path to be prepended to the path parameter for every request of the generated client. Introduce `setBasePath()` method on the OpenAPI request builder which allows to set the base path dynamically for every request to the client. - ```typescript const responseData = await MyApi.myFunction() .setBasePath('/base/path/to/service') From 28b25cdbdbdbcd85e1b5168d7add24bf0025be43 Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 15:49:56 +0100 Subject: [PATCH 28/59] chore: fix unit test --- packages/openapi/src/openapi-request-builder.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/openapi/src/openapi-request-builder.ts b/packages/openapi/src/openapi-request-builder.ts index b62493d20c..6de6bed659 100644 --- a/packages/openapi/src/openapi-request-builder.ts +++ b/packages/openapi/src/openapi-request-builder.ts @@ -147,10 +147,9 @@ export class OpenApiRequestBuilder { * @returns The request builder itself, to facilitate method chaining. */ setBasePath(basePath: string): this { - let sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; + const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; // Add a leading slash if basePath is not empty, as all Path Items start with a slash according to Swagger 3 - sanitizedBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; - this.basePath = sanitizedBasePath; + this.basePath = sanitizedBasePath ? '/' + sanitizedBasePath : undefined; return this; } From 6ce5e675b459a64c9974759a0eb1c626e70c53d1 Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 15:52:42 +0100 Subject: [PATCH 29/59] chore:cleanup --- packages/openapi-generator/src/file-serializer/api-file.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index cbd03e3208..50b481f3a7 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -36,7 +36,9 @@ export function apiFile( const apiDoc = apiDocumentation(api, serviceName); const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; // Add a leading slash if basePath is not empty, as all Path Items start with a slash according to Swagger 3 - const defaultBasePath = sanitizedBasePath ? '/' + sanitizedBasePath : ''; + const defaultBasePath = sanitizedBasePath + ? '/' + sanitizedBasePath + : undefined; const apiContent = codeBlock` export const ${api.name} = { _defaultBasePath: ${defaultBasePath ? `'${defaultBasePath}'` : undefined}, From 78dec6a812dbb2fb2d165e8735e9d58307d1a5c5 Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 15:58:48 +0100 Subject: [PATCH 30/59] chore: fix test --- packages/openapi-generator/src/generator.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openapi-generator/src/generator.spec.ts b/packages/openapi-generator/src/generator.spec.ts index 8e3ed659d2..7ba1600f10 100644 --- a/packages/openapi-generator/src/generator.spec.ts +++ b/packages/openapi-generator/src/generator.spec.ts @@ -98,7 +98,7 @@ describe('generator', () => { mock.restore(); const inputFile = resolve( __dirname, - '../../../test-resources/openapi-service-specs/test-service.json' + '../../../test-resources/openapi-service-specs/specifications/test-service.json' ); const serviceSpec = await promises.readFile(inputFile, { encoding: 'utf8' From b77dca7c60b07ddb05a5bb2e14dbae0f2b41aa4d Mon Sep 17 00:00:00 2001 From: i341658 Date: Mon, 9 Dec 2024 16:03:53 +0100 Subject: [PATCH 31/59] chore: cleanup changesets --- .changeset/chilled-flowers-freeze.md | 10 ++++++++++ .changeset/chilled-flowers-hide.md | 6 ------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 .changeset/chilled-flowers-freeze.md diff --git a/.changeset/chilled-flowers-freeze.md b/.changeset/chilled-flowers-freeze.md new file mode 100644 index 0000000000..e1b44cb5e2 --- /dev/null +++ b/.changeset/chilled-flowers-freeze.md @@ -0,0 +1,10 @@ +--- +'@sap-cloud-sdk/openapi': minor +--- + +[New Functionality] Introduce `setBasePath()` method on the OpenAPI request builder which allows to set the base path dynamically. This gets prepended with the path parameter for every request to the client. +```typescript +const responseData = await MyApi.myFunction() + .setBasePath('/base/path/to/service') + .execute(destination); +``` diff --git a/.changeset/chilled-flowers-hide.md b/.changeset/chilled-flowers-hide.md index 8d5004b2ee..65ee880528 100644 --- a/.changeset/chilled-flowers-hide.md +++ b/.changeset/chilled-flowers-hide.md @@ -5,9 +5,3 @@ --- [New Functionality] Support `basePath` in the `options-per-service.json` file in the OpenAPI generator. It enables the base path to be prepended to the path parameter for every request of the generated client. -Introduce `setBasePath()` method on the OpenAPI request builder which allows to set the base path dynamically for every request to the client. -```typescript -const responseData = await MyApi.myFunction() - .setBasePath('/base/path/to/service') - .execute(destination); -``` From d46219b2e9857c4df69353ce43161093a6e3e913 Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 10 Dec 2024 09:56:27 +0100 Subject: [PATCH 32/59] fix: integration test --- .../integration-tests/test/openapi-negative-case.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-packages/integration-tests/test/openapi-negative-case.spec.ts b/test-packages/integration-tests/test/openapi-negative-case.spec.ts index 17c2867a49..518d6c2153 100644 --- a/test-packages/integration-tests/test/openapi-negative-case.spec.ts +++ b/test-packages/integration-tests/test/openapi-negative-case.spec.ts @@ -61,7 +61,7 @@ describe('openapi negative tests', () => { '--input', resolve( testOutputRootDir, - '../../openapi-service-specs/test-service.json' + '../../openapi-service-specs/specifications/test-service.json' ), '-o', output, @@ -89,7 +89,7 @@ describe('openapi negative tests', () => { '-i', resolve( testResourcesDir, - '../../openapi-service-specs/test-service.json' + '../../openapi-service-specs/specifications/test-service.json' ), '-o', output, From a5146d75dbd76f64b4da426b9347aff114bb0bd3 Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 10 Dec 2024 10:27:15 +0100 Subject: [PATCH 33/59] chore: fix path --- test-packages/e2e-tests/openapi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-packages/e2e-tests/openapi.js b/test-packages/e2e-tests/openapi.js index 198a385ee8..39567cceb6 100644 --- a/test-packages/e2e-tests/openapi.js +++ b/test-packages/e2e-tests/openapi.js @@ -24,7 +24,7 @@ function mockTestEntity(schema) { async function createApi() { const api = new OpenAPIBackend({ - definition: '../../test-resources/openapi-service-specs/test-service.json' + definition: '../../test-resources/openapi-service-specs/specifications/test-service.json' }); const schema = await getSchemas(); From d4eac1fc214de3aa0cb72e345786d14b39581f21 Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 10 Dec 2024 10:56:26 +0100 Subject: [PATCH 34/59] chore:fix path --- test-packages/e2e-tests/openapi.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-packages/e2e-tests/openapi.js b/test-packages/e2e-tests/openapi.js index 39567cceb6..8cedff1181 100644 --- a/test-packages/e2e-tests/openapi.js +++ b/test-packages/e2e-tests/openapi.js @@ -8,7 +8,7 @@ const jsf = require('json-schema-faker'); async function getSchemas() { // SchemaObject const document = await SwaggerParser.dereference( - '../../test-resources/openapi-service-specs/test-service.json' + '../../test-resources/openapi-service-specs/specifications/test-service.json' ); return document.components.schemas; From f7e8de308ba6e164e06ac3cf3279c2dbf157a10a Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 10 Dec 2024 11:10:21 +0100 Subject: [PATCH 35/59] chore: remove dead code --- .../src/file-serializer/operation.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/operation.ts b/packages/openapi-generator/src/file-serializer/operation.ts index 6a007a9a9d..4b2bd1896b 100644 --- a/packages/openapi-generator/src/file-serializer/operation.ts +++ b/packages/openapi-generator/src/file-serializer/operation.ts @@ -31,7 +31,7 @@ export function serializeOperation( const responseType = serializeSchema(operation.response); return codeBlock` -${operationDocumentation(operation, operation.pathPattern)} +${operationDocumentation(operation)} ${operation.operationId}: (${serializeOperationSignature( operation )}) => new OpenApiRequestBuilder<${responseType}>( @@ -138,10 +138,7 @@ function serializeParamsForRequestBuilder( /** * @internal */ -export function operationDocumentation( - operation: OpenApiOperation, - pathPatternWithBasePath?: string -): string { +export function operationDocumentation(operation: OpenApiOperation): string { const signature: string[] = []; if (operation.pathParameters.length) { signature.push(...getSignatureOfPathParameters(operation.pathParameters)); @@ -166,10 +163,7 @@ export function operationDocumentation( signature.push( '@returns The request builder, use the `execute()` method to trigger the request.' ); - const lines = [ - getOperationDescriptionText(operation, pathPatternWithBasePath), - ...signature - ]; + const lines = [getOperationDescriptionText(operation), ...signature]; return documentationBlock`${lines.join(unixEOL)}`; } @@ -186,13 +180,10 @@ function getSignatureOfBody(body: OpenApiRequestBody): string { return `@param body - ${body.description || 'Request body.'}`; } -function getOperationDescriptionText( - operation: OpenApiOperation, - pathPatternWithBasePath?: string -): string { +function getOperationDescriptionText(operation: OpenApiOperation): string { if (operation.description) { return operation.description; } - return `Create a request builder for execution of ${operation.method} requests to the '${pathPatternWithBasePath || operation.pathPattern}' endpoint.`; + return `Create a request builder for execution of ${operation.method} requests to the '${operation.pathPattern}' endpoint.`; } From b9242b4d6a172de6f42dcd33bb0fbc179f68a926 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 12 Dec 2024 09:32:49 +0100 Subject: [PATCH 36/59] chore: review comment --- .changeset/chilled-flowers-freeze.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.changeset/chilled-flowers-freeze.md b/.changeset/chilled-flowers-freeze.md index e1b44cb5e2..a27d13b157 100644 --- a/.changeset/chilled-flowers-freeze.md +++ b/.changeset/chilled-flowers-freeze.md @@ -3,8 +3,3 @@ --- [New Functionality] Introduce `setBasePath()` method on the OpenAPI request builder which allows to set the base path dynamically. This gets prepended with the path parameter for every request to the client. -```typescript -const responseData = await MyApi.myFunction() - .setBasePath('/base/path/to/service') - .execute(destination); -``` From 620f79373a31f8318b69dad8679a4fa71f92b933 Mon Sep 17 00:00:00 2001 From: KavithaSiva <32287936+KavithaSiva@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:33:20 +0100 Subject: [PATCH 37/59] Update .changeset/chilled-flowers-hide.md Co-authored-by: Deeksha Sinha <88374536+deekshas8@users.noreply.github.com> --- .changeset/chilled-flowers-hide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/chilled-flowers-hide.md b/.changeset/chilled-flowers-hide.md index 65ee880528..77f1c525d3 100644 --- a/.changeset/chilled-flowers-hide.md +++ b/.changeset/chilled-flowers-hide.md @@ -4,4 +4,4 @@ '@sap-cloud-sdk/util': minor --- -[New Functionality] Support `basePath` in the `options-per-service.json` file in the OpenAPI generator. It enables the base path to be prepended to the path parameter for every request of the generated client. +[New Functionality] Support `basePath` option in the `options-per-service.json` file in the OpenAPI generator. It enables the base path to be prepended to the path parameter for every request of the generated client. From ac017c2ed3dd1534bb8128deaeed9de24a429cf5 Mon Sep 17 00:00:00 2001 From: KavithaSiva <32287936+KavithaSiva@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:59:25 +0100 Subject: [PATCH 38/59] Update packages/openapi/src/openapi-request-builder.ts Co-authored-by: Deeksha Sinha <88374536+deekshas8@users.noreply.github.com> --- packages/openapi/src/openapi-request-builder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openapi/src/openapi-request-builder.ts b/packages/openapi/src/openapi-request-builder.ts index 6de6bed659..d6b214c3e6 100644 --- a/packages/openapi/src/openapi-request-builder.ts +++ b/packages/openapi/src/openapi-request-builder.ts @@ -46,7 +46,7 @@ export class OpenApiRequestBuilder { public method: Method, private pathPattern: string, private parameters?: OpenApiRequestParameters, - private basePath?: string | undefined + private basePath?: string ) {} /** From df3be1ef2f3e62949016754e53776a7ef8c094e4 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 12 Dec 2024 10:13:57 +0100 Subject: [PATCH 39/59] chore: address review comments --- packages/openapi-generator/src/file-serializer/operation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openapi-generator/src/file-serializer/operation.ts b/packages/openapi-generator/src/file-serializer/operation.ts index 4b2bd1896b..593e650afd 100644 --- a/packages/openapi-generator/src/file-serializer/operation.ts +++ b/packages/openapi-generator/src/file-serializer/operation.ts @@ -9,7 +9,7 @@ import type { /** * Serialize an operation to a string. * @param operation - Operation to serialize. - * @param apiName - Name of the API being serialized. + * @param apiName - Name of the API the operation is part of. * @returns The operation as a string. * @internal */ From 804a763042146657994cbcacd30600c40e594926 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 12 Dec 2024 10:36:42 +0100 Subject: [PATCH 40/59] chore: revert update to removeSlashes utility --- packages/util/src/remove-slashes.spec.ts | 7 ------- packages/util/src/remove-slashes.ts | 10 ++-------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/util/src/remove-slashes.spec.ts b/packages/util/src/remove-slashes.spec.ts index 7b93bb29f5..1a72a9c656 100644 --- a/packages/util/src/remove-slashes.spec.ts +++ b/packages/util/src/remove-slashes.spec.ts @@ -11,14 +11,7 @@ describe('removeSlashes', () => { it('removes leading slashes', () => { expect(removeLeadingSlashes('/test')).toBe('test'); }); - it('removes multiple leading slashes', () => { - expect(removeLeadingSlashes('///test/')).toBe('test/'); - }); it('removes trailing slashes', () => { expect(removeTrailingSlashes('/test/')).toBe('/test'); }); - - it('removes multiple trailing slashes', () => { - expect(removeTrailingSlashes('/test///')).toBe('/test'); - }); }); diff --git a/packages/util/src/remove-slashes.ts b/packages/util/src/remove-slashes.ts index e2d391b6a6..953ad20433 100644 --- a/packages/util/src/remove-slashes.ts +++ b/packages/util/src/remove-slashes.ts @@ -11,18 +11,12 @@ export function removeSlashes(path: string): string { * @internal */ export function removeTrailingSlashes(path: string): string { - while (path.endsWith('/')) { - path = path.endsWith('/') ? path.slice(0, -1) : path; - } - return path; + return path.endsWith('/') ? path.slice(0, -1) : path; } /** * @internal */ export function removeLeadingSlashes(path: string): string { - while (path.startsWith('/')) { - path = path.startsWith('/') ? path.slice(1) : path; - } - return path; + return path.startsWith('/') ? path.slice(1) : path; } From c5b6a6063564b8b8648192147390d0c990691562 Mon Sep 17 00:00:00 2001 From: cloud-sdk-js Date: Thu, 12 Dec 2024 09:39:00 +0000 Subject: [PATCH 41/59] Changes from lint:fix --- .github/actions/check-public-api/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/actions/check-public-api/index.js b/.github/actions/check-public-api/index.js index 23603865fb..2c79671c95 100644 --- a/.github/actions/check-public-api/index.js +++ b/.github/actions/check-public-api/index.js @@ -74871,19 +74871,13 @@ function removeSlashes(path) { * @internal */ function removeTrailingSlashes(path) { - while (path.endsWith('/')) { - path = path.endsWith('/') ? path.slice(0, -1) : path; - } - return path; + return path.endsWith('/') ? path.slice(0, -1) : path; } /** * @internal */ function removeLeadingSlashes(path) { - while (path.startsWith('/')) { - path = path.startsWith('/') ? path.slice(1) : path; - } - return path; + return path.startsWith('/') ? path.slice(1) : path; } //# sourceMappingURL=remove-slashes.js.map From 213435398175ada7de51b654aa67450e108b2a32 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 12 Dec 2024 13:57:33 +0100 Subject: [PATCH 42/59] chore: address review comments --- .../openapi-generator/src/file-serializer/api-file.spec.ts | 2 +- packages/openapi-generator/src/file-serializer/api-file.ts | 6 +----- packages/openapi/src/openapi-request-builder.ts | 6 ++---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.spec.ts b/packages/openapi-generator/src/file-serializer/api-file.spec.ts index 05c2be094a..04aeda4f10 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.spec.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.spec.ts @@ -130,7 +130,7 @@ describe('api-file', () => { multipleOperationApi, 'MyServiceName', undefined, - '///base/path/to/service///' + '/base/path/to/service/' ) ).toMatchSnapshot(); }); diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index 50b481f3a7..57036fb711 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -34,11 +34,7 @@ export function apiFile( ): string { const imports = serializeImports(getImports(api, options)); const apiDoc = apiDocumentation(api, serviceName); - const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; - // Add a leading slash if basePath is not empty, as all Path Items start with a slash according to Swagger 3 - const defaultBasePath = sanitizedBasePath - ? '/' + sanitizedBasePath - : undefined; + const defaultBasePath = basePath ? removeSlashes(basePath) : undefined; const apiContent = codeBlock` export const ${api.name} = { _defaultBasePath: ${defaultBasePath ? `'${defaultBasePath}'` : undefined}, diff --git a/packages/openapi/src/openapi-request-builder.ts b/packages/openapi/src/openapi-request-builder.ts index d6b214c3e6..6a0313392f 100644 --- a/packages/openapi/src/openapi-request-builder.ts +++ b/packages/openapi/src/openapi-request-builder.ts @@ -147,9 +147,7 @@ export class OpenApiRequestBuilder { * @returns The request builder itself, to facilitate method chaining. */ setBasePath(basePath: string): this { - const sanitizedBasePath = basePath ? removeSlashes(basePath) : ''; - // Add a leading slash if basePath is not empty, as all Path Items start with a slash according to Swagger 3 - this.basePath = sanitizedBasePath ? '/' + sanitizedBasePath : undefined; + this.basePath = basePath; return this; } @@ -191,7 +189,7 @@ export class OpenApiRequestBuilder { const placeholders: string[] = this.pathPattern.match(/{[^/?#{}]+}/g) || []; return ( - (this.basePath ?? '') + + (this.basePath ? removeSlashes(this.basePath) : '') + placeholders.reduce((path: string, placeholder: string) => { const strippedPlaceholder = placeholder.slice(1, -1); const parameterValue = pathParameters[strippedPlaceholder]; From a5e74a398a1bc5d0316ef1f37a37d086c25b7921 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 12 Dec 2024 13:57:43 +0100 Subject: [PATCH 43/59] chore: tests fix --- .../src/file-serializer/__snapshots__/api-file.spec.ts.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap index 9c0699e9a5..97a66aa647 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap @@ -120,7 +120,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; * This API is part of the 'MyServiceName' service. */ export const TestApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: 'base/path/to/service', /** * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. From 9e697fb7eb7be9772f357d0b99db66d2dac83e59 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 12 Dec 2024 14:04:33 +0100 Subject: [PATCH 44/59] chore: adjust tests --- .../test-services-openapi/no-schema-service/default-api.js | 2 +- .../test-services-openapi/no-schema-service/default-api.js.map | 2 +- .../test-services-openapi/no-schema-service/default-api.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.js b/test-packages/test-services-openapi/no-schema-service/default-api.js index b576ab1813..30e50da692 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.js +++ b/test-packages/test-services-openapi/no-schema-service/default-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'no-schema-service' service. */ exports.DefaultApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: 'base/path/to/service', /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.js.map b/test-packages/test-services-openapi/no-schema-service/default-api.js.map index bc2271cfd7..db8ea80678 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.js.map +++ b/test-packages/test-services-openapi/no-schema-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,GAAG,EAAE,GAAG,EAAE,CACR,IAAI,+BAAqB,CAAM,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAU,CAAC,gBAAgB,CAAC;CAC9E,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,sBAAsB;IACxC;;;OAGG;IACH,GAAG,EAAE,GAAG,EAAE,CACR,IAAI,+BAAqB,CAAM,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAU,CAAC,gBAAgB,CAAC;CAC9E,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.ts b/test-packages/test-services-openapi/no-schema-service/default-api.ts index c52dc2a013..bb71980890 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.ts +++ b/test-packages/test-services-openapi/no-schema-service/default-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'no-schema-service' service. */ export const DefaultApi = { - _defaultBasePath: '/base/path/to/service', + _defaultBasePath: 'base/path/to/service', /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. From 076f9711ae6c55d81ebd7e5a88f008b7f1f2fc00 Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 13 Dec 2024 08:39:47 +0100 Subject: [PATCH 45/59] chore: address review comments --- .../src/file-serializer/__snapshots__/api-file.spec.ts.snap | 2 +- packages/openapi-generator/src/file-serializer/api-file.ts | 3 +-- .../test-services-openapi/no-schema-service/default-api.js | 2 +- .../test-services-openapi/no-schema-service/default-api.js.map | 2 +- .../test-services-openapi/no-schema-service/default-api.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap index 97a66aa647..56f559cbaa 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap @@ -120,7 +120,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; * This API is part of the 'MyServiceName' service. */ export const TestApi = { - _defaultBasePath: 'base/path/to/service', + _defaultBasePath: '/base/path/to/service/', /** * Create a request builder for execution of get requests to the 'test/{id}' endpoint. * @param id - Path parameter. diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index 57036fb711..033342c518 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -34,10 +34,9 @@ export function apiFile( ): string { const imports = serializeImports(getImports(api, options)); const apiDoc = apiDocumentation(api, serviceName); - const defaultBasePath = basePath ? removeSlashes(basePath) : undefined; const apiContent = codeBlock` export const ${api.name} = { - _defaultBasePath: ${defaultBasePath ? `'${defaultBasePath}'` : undefined}, + _defaultBasePath: ${basePath ? `'${basePath}'` : undefined}, ${api.operations.map(operation => serializeOperation(operation, api.name)).join(',\n')} }; `; diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.js b/test-packages/test-services-openapi/no-schema-service/default-api.js index 30e50da692..b576ab1813 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.js +++ b/test-packages/test-services-openapi/no-schema-service/default-api.js @@ -12,7 +12,7 @@ const openapi_1 = require("@sap-cloud-sdk/openapi"); * This API is part of the 'no-schema-service' service. */ exports.DefaultApi = { - _defaultBasePath: 'base/path/to/service', + _defaultBasePath: '/base/path/to/service', /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.js.map b/test-packages/test-services-openapi/no-schema-service/default-api.js.map index db8ea80678..bc2271cfd7 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.js.map +++ b/test-packages/test-services-openapi/no-schema-service/default-api.js.map @@ -1 +1 @@ -{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,sBAAsB;IACxC;;;OAGG;IACH,GAAG,EAAE,GAAG,EAAE,CACR,IAAI,+BAAqB,CAAM,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAU,CAAC,gBAAgB,CAAC;CAC9E,CAAC"} \ No newline at end of file +{"version":3,"file":"default-api.js","sourceRoot":"","sources":["default-api.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAA+D;AAC/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE,uBAAuB;IACzC;;;OAGG;IACH,GAAG,EAAE,GAAG,EAAE,CACR,IAAI,+BAAqB,CAAM,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAU,CAAC,gBAAgB,CAAC;CAC9E,CAAC"} \ No newline at end of file diff --git a/test-packages/test-services-openapi/no-schema-service/default-api.ts b/test-packages/test-services-openapi/no-schema-service/default-api.ts index bb71980890..c52dc2a013 100644 --- a/test-packages/test-services-openapi/no-schema-service/default-api.ts +++ b/test-packages/test-services-openapi/no-schema-service/default-api.ts @@ -9,7 +9,7 @@ import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi'; * This API is part of the 'no-schema-service' service. */ export const DefaultApi = { - _defaultBasePath: 'base/path/to/service', + _defaultBasePath: '/base/path/to/service', /** * Create a request builder for execution of get requests to the '/' endpoint. * @returns The request builder, use the `execute()` method to trigger the request. From ed82ff39ddcd6eb46359220ea64c453fa5cceed4 Mon Sep 17 00:00:00 2001 From: cloud-sdk-js Date: Fri, 13 Dec 2024 07:42:04 +0000 Subject: [PATCH 46/59] Changes from lint:fix --- packages/openapi-generator/src/file-serializer/api-file.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index 033342c518..6ed7f2f961 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -1,9 +1,4 @@ -import { - codeBlock, - documentationBlock, - removeSlashes, - unixEOL -} from '@sap-cloud-sdk/util'; +import { codeBlock, documentationBlock, unixEOL } from '@sap-cloud-sdk/util'; import { serializeImports } from '@sap-cloud-sdk/generator-common/internal'; import { collectRefs, getUniqueRefs } from '../schema-util'; import { serializeOperation } from './operation'; From a6744ce79793c26376706636c30c184d63caa24c Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 13 Dec 2024 15:32:12 +0100 Subject: [PATCH 47/59] fix: begin all paths using '/' --- .../__snapshots__/api-file.spec.ts.snap | 32 +++++++++---------- .../src/file-serializer/api-file.spec.ts | 8 ++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap index 56f559cbaa..6925f7502f 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap @@ -10,7 +10,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema/index.j export const TestApi = { _defaultBasePath: undefined, /** - * Create a request builder for execution of get requests to the 'test/{id}' endpoint. + * Create a request builder for execution of get requests to the '/test/{id}' endpoint. * @param id - Path parameter. * @param queryParameters - Object containing the following keys: queryParam. * @param headerParameters - Object containing the following keys: headerParam. @@ -18,7 +18,7 @@ export const TestApi = { */ getFn: (id: string, queryParameters: {'queryParam': QueryParameterType}, headerParameters?: {'headerParam'?: string}) => new OpenApiRequestBuilder( 'get', - "test/{id}", + "/test/{id}", { pathParameters: { id }, queryParameters, @@ -27,13 +27,13 @@ export const TestApi = { TestApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the 'test' endpoint. + * Create a request builder for execution of post requests to the '/test' endpoint. * @param body - Request body. * @returns The request builder, use the \`execute()\` method to trigger the request. */ createFn: (body: RefType) => new OpenApiRequestBuilder( 'post', - "test", + "/test", { body }, @@ -51,12 +51,12 @@ exports[`api-file creates an api file with documentation 1`] = ` export const TestApi = { _defaultBasePath: undefined, /** - * Create a request builder for execution of get requests to the 'test' endpoint. + * Create a request builder for execution of get requests to the '/test' endpoint. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: () => new OpenApiRequestBuilder( 'get', - "test", + "/test", {}, TestApi._defaultBasePath ) @@ -80,7 +80,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; export const TestApi = { _defaultBasePath: undefined, /** - * Create a request builder for execution of get requests to the 'test/{id}' endpoint. + * Create a request builder for execution of get requests to the '/test/{id}' endpoint. * @param id - Path parameter. * @param queryParameters - Object containing the following keys: queryParam. * @param headerParameters - Object containing the following keys: headerParam. @@ -88,7 +88,7 @@ export const TestApi = { */ getFn: (id: string, queryParameters: {'queryParam': QueryParameterType}, headerParameters?: {'headerParam'?: string}) => new OpenApiRequestBuilder( 'get', - "test/{id}", + "/test/{id}", { pathParameters: { id }, queryParameters, @@ -97,13 +97,13 @@ export const TestApi = { TestApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the 'test' endpoint. + * Create a request builder for execution of post requests to the '/test' endpoint. * @param body - Request body. * @returns The request builder, use the \`execute()\` method to trigger the request. */ createFn: (body: RefType) => new OpenApiRequestBuilder( 'post', - "test", + "/test", { body }, @@ -122,7 +122,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; export const TestApi = { _defaultBasePath: '/base/path/to/service/', /** - * Create a request builder for execution of get requests to the 'test/{id}' endpoint. + * Create a request builder for execution of get requests to the '/test/{id}' endpoint. * @param id - Path parameter. * @param queryParameters - Object containing the following keys: queryParam. * @param headerParameters - Object containing the following keys: headerParam. @@ -130,7 +130,7 @@ export const TestApi = { */ getFn: (id: string, queryParameters: {'queryParam': QueryParameterType}, headerParameters?: {'headerParam'?: string}) => new OpenApiRequestBuilder( 'get', - "test/{id}", + "/test/{id}", { pathParameters: { id }, queryParameters, @@ -139,13 +139,13 @@ export const TestApi = { TestApi._defaultBasePath ), /** - * Create a request builder for execution of post requests to the 'test' endpoint. + * Create a request builder for execution of post requests to the '/test' endpoint. * @param body - Request body. * @returns The request builder, use the \`execute()\` method to trigger the request. */ createFn: (body: RefType) => new OpenApiRequestBuilder( 'post', - "test", + "/test", { body }, @@ -163,13 +163,13 @@ exports[`api-file serializes api file with one operation and no references 1`] = export const TestApi = { _defaultBasePath: undefined, /** - * Create a request builder for execution of get requests to the 'test/{id}' endpoint. + * Create a request builder for execution of get requests to the '/test/{id}' endpoint. * @param id - Path parameter. * @returns The request builder, use the \`execute()\` method to trigger the request. */ getFn: (id: string) => new OpenApiRequestBuilder( 'get', - "test/{id}", + "/test/{id}", { pathParameters: { id } }, diff --git a/packages/openapi-generator/src/file-serializer/api-file.spec.ts b/packages/openapi-generator/src/file-serializer/api-file.spec.ts index 04aeda4f10..c139e0ae00 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.spec.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.spec.ts @@ -23,7 +23,7 @@ const singleOperationApi: OpenApiApi = { headerParameters: [], response: { type: 'any' }, responses: { 200: { description: 'some response description' } }, - pathPattern: 'test/{id}' + pathPattern: '/test/{id}' } ] }; @@ -71,7 +71,7 @@ const multipleOperationApi: OpenApiApi = { schemaProperties: {} } ], - pathPattern: 'test/{id}', + pathPattern: '/test/{id}', response: { type: 'string' } }, { @@ -89,7 +89,7 @@ const multipleOperationApi: OpenApiApi = { schemaName: 'RefType' } as OpenApiReferenceSchema }, - pathPattern: 'test', + pathPattern: '/test', response: { $ref: '#/components/schemas/ResponseType', schemaName: 'ResponseType' @@ -110,7 +110,7 @@ const docsApi: OpenApiApi = { queryParameters: [], headerParameters: [], response: { type: 'any' }, - pathPattern: 'test' + pathPattern: '/test' } ] }; From 99ee4f23ca71e1c2da6850998d47d0dff62c062f Mon Sep 17 00:00:00 2001 From: i341658 Date: Fri, 13 Dec 2024 15:51:12 +0100 Subject: [PATCH 48/59] chore: address review comments --- packages/openapi-generator/src/file-serializer/api-file.ts | 2 +- packages/openapi/src/openapi-request-builder.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index 6ed7f2f961..448e166969 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -17,7 +17,7 @@ import type { * @param api - Representation of an API. * @param serviceName - Service name for which the API is created. * @param options - Options to configure the file creation. - * @param basePath - Base path for the API obtained from optionsPerService. + * @param basePath - Base path for the API. * @returns The serialized API file contents. * @internal */ diff --git a/packages/openapi/src/openapi-request-builder.spec.ts b/packages/openapi/src/openapi-request-builder.spec.ts index c9e2b74fea..46a97fc5b1 100644 --- a/packages/openapi/src/openapi-request-builder.spec.ts +++ b/packages/openapi/src/openapi-request-builder.spec.ts @@ -80,14 +80,14 @@ describe('openapi-request-builder', () => { const requestBuilder = new OpenApiRequestBuilder( 'get', '/test' - ).setBasePath('//base/path/to/service/'); + ).setBasePath('/base/path/to/service/'); const response = await requestBuilder.executeRaw(destination); expect(httpClient.executeHttpRequest).toHaveBeenCalledWith( sanitizeDestination(destination), { method: 'get', middleware: [], - url: '/base/path/to/service/test', + url: 'base/path/to/service/test', headers: { requestConfig: {} }, params: { requestConfig: {} }, data: undefined From 61597a77ec2afaa26653dcb3a356570982bde2d5 Mon Sep 17 00:00:00 2001 From: KavithaSiva <32287936+KavithaSiva@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:03:08 +0100 Subject: [PATCH 49/59] Update .changeset/chilled-flowers-hide.md Co-authored-by: Deeksha Sinha <88374536+deekshas8@users.noreply.github.com> --- .changeset/chilled-flowers-hide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/chilled-flowers-hide.md b/.changeset/chilled-flowers-hide.md index 77f1c525d3..95395a70d0 100644 --- a/.changeset/chilled-flowers-hide.md +++ b/.changeset/chilled-flowers-hide.md @@ -4,4 +4,4 @@ '@sap-cloud-sdk/util': minor --- -[New Functionality] Support `basePath` option in the `options-per-service.json` file in the OpenAPI generator. It enables the base path to be prepended to the path parameter for every request of the generated client. +[New Functionality] Add `basePath` option in the `options-per-service.json` file in the OpenAPI generator. This option prepends the base URL path to the API path for every request. From 8261772763badd8b170c7b89404eb3fbf5dd21b7 Mon Sep 17 00:00:00 2001 From: KavithaSiva <32287936+KavithaSiva@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:03:58 +0100 Subject: [PATCH 50/59] Update .changeset/chilled-flowers-freeze.md Co-authored-by: Deeksha Sinha <88374536+deekshas8@users.noreply.github.com> --- .changeset/chilled-flowers-freeze.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/chilled-flowers-freeze.md b/.changeset/chilled-flowers-freeze.md index a27d13b157..cbe033a33d 100644 --- a/.changeset/chilled-flowers-freeze.md +++ b/.changeset/chilled-flowers-freeze.md @@ -2,4 +2,4 @@ '@sap-cloud-sdk/openapi': minor --- -[New Functionality] Introduce `setBasePath()` method on the OpenAPI request builder which allows to set the base path dynamically. This gets prepended with the path parameter for every request to the client. +[New Functionality] Introduce `setBasePath()` method on the OpenAPI request builder, allowing a custom base path URL to be set for a single request. This base path is prepended to the API path for that request. From d5dbf497a2a3ca08ae9596d282873f9f8468ee3b Mon Sep 17 00:00:00 2001 From: KavithaSiva <32287936+KavithaSiva@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:09:46 +0100 Subject: [PATCH 51/59] Update packages/util/src/remove-slashes.spec.ts Co-authored-by: Deeksha Sinha <88374536+deekshas8@users.noreply.github.com> --- packages/util/src/remove-slashes.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/util/src/remove-slashes.spec.ts b/packages/util/src/remove-slashes.spec.ts index 1a72a9c656..ec8ee92dac 100644 --- a/packages/util/src/remove-slashes.spec.ts +++ b/packages/util/src/remove-slashes.spec.ts @@ -11,7 +11,7 @@ describe('removeSlashes', () => { it('removes leading slashes', () => { expect(removeLeadingSlashes('/test')).toBe('test'); }); - it('removes trailing slashes', () => { + it('removes trailing slash', () => { expect(removeTrailingSlashes('/test/')).toBe('/test'); }); }); From 2ac2abe3bad7c1498b0844ff51179aed0cfb9a5f Mon Sep 17 00:00:00 2001 From: KavithaSiva <32287936+KavithaSiva@users.noreply.github.com> Date: Tue, 17 Dec 2024 10:09:57 +0100 Subject: [PATCH 52/59] Update packages/util/src/remove-slashes.spec.ts Co-authored-by: Deeksha Sinha <88374536+deekshas8@users.noreply.github.com> --- packages/util/src/remove-slashes.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/util/src/remove-slashes.spec.ts b/packages/util/src/remove-slashes.spec.ts index ec8ee92dac..688aa4d677 100644 --- a/packages/util/src/remove-slashes.spec.ts +++ b/packages/util/src/remove-slashes.spec.ts @@ -8,7 +8,7 @@ describe('removeSlashes', () => { it('removes trailing slashes', () => { expect(removeSlashes('/test/')).toBe('test'); }); - it('removes leading slashes', () => { + it('removes leading slash', () => { expect(removeLeadingSlashes('/test')).toBe('test'); }); it('removes trailing slash', () => { From e9d0e031b1061ab39bb90cc0f4ccf02c95063ed6 Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 17 Dec 2024 10:15:00 +0100 Subject: [PATCH 53/59] chore: address review comments --- .changeset/chilled-flowers-freeze.md | 2 +- .changeset/chilled-flowers-hide.md | 2 +- packages/util/src/remove-slashes.spec.ts | 2 +- packages/util/src/remove-slashes.ts | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.changeset/chilled-flowers-freeze.md b/.changeset/chilled-flowers-freeze.md index cbe033a33d..16555b76f1 100644 --- a/.changeset/chilled-flowers-freeze.md +++ b/.changeset/chilled-flowers-freeze.md @@ -2,4 +2,4 @@ '@sap-cloud-sdk/openapi': minor --- -[New Functionality] Introduce `setBasePath()` method on the OpenAPI request builder, allowing a custom base path URL to be set for a single request. This base path is prepended to the API path for that request. +[New Functionality] Introduce `setBasePath()` method on the OpenAPI request builder, allowing a custom base path URL to be set for a single request. This base path is prepended to the API path parameter for that request. diff --git a/.changeset/chilled-flowers-hide.md b/.changeset/chilled-flowers-hide.md index 95395a70d0..4cd7dc30a3 100644 --- a/.changeset/chilled-flowers-hide.md +++ b/.changeset/chilled-flowers-hide.md @@ -4,4 +4,4 @@ '@sap-cloud-sdk/util': minor --- -[New Functionality] Add `basePath` option in the `options-per-service.json` file in the OpenAPI generator. This option prepends the base URL path to the API path for every request. +[New Functionality] Add `basePath` option in the `options-per-service.json` file in the OpenAPI generator. This option prepends the base URL path to the API path parameter for every request. diff --git a/packages/util/src/remove-slashes.spec.ts b/packages/util/src/remove-slashes.spec.ts index 688aa4d677..5f2bc6acaa 100644 --- a/packages/util/src/remove-slashes.spec.ts +++ b/packages/util/src/remove-slashes.spec.ts @@ -5,7 +5,7 @@ import { } from './remove-slashes'; describe('removeSlashes', () => { - it('removes trailing slashes', () => { + it('removes a single leading and trailing slash', () => { expect(removeSlashes('/test/')).toBe('test'); }); it('removes leading slash', () => { diff --git a/packages/util/src/remove-slashes.ts b/packages/util/src/remove-slashes.ts index 953ad20433..972f0e4ab3 100644 --- a/packages/util/src/remove-slashes.ts +++ b/packages/util/src/remove-slashes.ts @@ -1,5 +1,6 @@ /** * @internal + * Utility function to remove a single leading and trailing slash from a path. */ export function removeSlashes(path: string): string { path = removeLeadingSlashes(path); @@ -9,6 +10,7 @@ export function removeSlashes(path: string): string { /** * @internal + * Utility function to remove a single trailing slash from a path. */ export function removeTrailingSlashes(path: string): string { return path.endsWith('/') ? path.slice(0, -1) : path; @@ -16,6 +18,7 @@ export function removeTrailingSlashes(path: string): string { /** * @internal + * Utility function to remove a single leading slash from a path. */ export function removeLeadingSlashes(path: string): string { return path.startsWith('/') ? path.slice(1) : path; From 5f1e6dac31bd2ca627d690b56f5479906a983351 Mon Sep 17 00:00:00 2001 From: cloud-sdk-js Date: Tue, 17 Dec 2024 09:17:12 +0000 Subject: [PATCH 54/59] Changes from lint:fix --- .github/actions/check-public-api/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/check-public-api/index.js b/.github/actions/check-public-api/index.js index 2c79671c95..cf1c62e2e3 100644 --- a/.github/actions/check-public-api/index.js +++ b/.github/actions/check-public-api/index.js @@ -74861,6 +74861,7 @@ exports.removeTrailingSlashes = removeTrailingSlashes; exports.removeLeadingSlashes = removeLeadingSlashes; /** * @internal + * Utility function to remove a single leading and trailing slash from a path. */ function removeSlashes(path) { path = removeLeadingSlashes(path); @@ -74869,12 +74870,14 @@ function removeSlashes(path) { } /** * @internal + * Utility function to remove a single trailing slash from a path. */ function removeTrailingSlashes(path) { return path.endsWith('/') ? path.slice(0, -1) : path; } /** * @internal + * Utility function to remove a single leading slash from a path. */ function removeLeadingSlashes(path) { return path.startsWith('/') ? path.slice(1) : path; From 252781b30faab9c13612db2d22826336bdef968b Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 17 Dec 2024 10:21:01 +0100 Subject: [PATCH 55/59] chore: add review changes --- .../openapi/src/openapi-request-builder.spec.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/openapi/src/openapi-request-builder.spec.ts b/packages/openapi/src/openapi-request-builder.spec.ts index 46a97fc5b1..0fbf6fe77b 100644 --- a/packages/openapi/src/openapi-request-builder.spec.ts +++ b/packages/openapi/src/openapi-request-builder.spec.ts @@ -36,7 +36,7 @@ describe('openapi-request-builder', () => { httpSpy.mockClear(); }); - it('executeRaw executes a request without parameters', async () => { + it('executes a request without parameters using executeRaw', async () => { const requestBuilder = new OpenApiRequestBuilder('get', '/test'); const response = await requestBuilder.executeRaw(destination); expect(httpSpy).toHaveBeenCalledWith( @@ -54,7 +54,7 @@ describe('openapi-request-builder', () => { expect(response.data).toBe(dummyResponse); }); - it('executeRaw executes a request with query parameters', async () => { + it('executes a request with query parameters using executeRaw', async () => { const requestBuilder = new OpenApiRequestBuilder('get', '/test', { queryParameters: { limit: 100 @@ -76,7 +76,7 @@ describe('openapi-request-builder', () => { expect(response.data).toBe(dummyResponse); }); - it('executeRaw executes a request without parameters and basePath explicitly set', async () => { + it('executes a request without parameters and basePath explicitly set using executeRaw', async () => { const requestBuilder = new OpenApiRequestBuilder( 'get', '/test' @@ -97,7 +97,7 @@ describe('openapi-request-builder', () => { expect(response.data).toBe(dummyResponse); }); - it('executeRaw executes a request with header parameters', async () => { + it('executes a request with header parameters using executeRaw', async () => { const destinationWithAuth = { ...destination, headers: { authorization: 'destAuth' } @@ -125,7 +125,7 @@ describe('openapi-request-builder', () => { expect(response.data).toBe(dummyResponse); }); - it('executeRaw executes a request with body', async () => { + it('executes a request with body using executeRaw', async () => { const requestBuilder = new OpenApiRequestBuilder('post', '/test', { body: { limit: 100 @@ -251,7 +251,7 @@ describe('openapi-request-builder', () => { expect(response.data).toBe('iss token used on the way'); }); - it('addCustomHeaders', async () => { + it('should add custom headers', async () => { const requestBuilder = new OpenApiRequestBuilder('get', '/test'); const destinationWithAuth = { ...destination, @@ -318,7 +318,7 @@ describe('openapi-request-builder', () => { ); }); - it('addCustomRequestConfig', async () => { + it('should add custom request config', async () => { const requestBuilder = new OpenApiRequestBuilder('get', '/test'); const response = await requestBuilder .addCustomRequestConfiguration({ From 0ee7e6be865a7d1f71165699075feb8d84d6d76b Mon Sep 17 00:00:00 2001 From: i341658 Date: Tue, 17 Dec 2024 10:34:42 +0100 Subject: [PATCH 56/59] chore: address review comments --- packages/openapi-generator/src/file-serializer/api-file.ts | 2 +- packages/openapi/src/openapi-request-builder.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.ts b/packages/openapi-generator/src/file-serializer/api-file.ts index 448e166969..749143b58d 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.ts @@ -17,7 +17,7 @@ import type { * @param api - Representation of an API. * @param serviceName - Service name for which the API is created. * @param options - Options to configure the file creation. - * @param basePath - Base path for the API. + * @param basePath - Custom base path for the API. * @returns The serialized API file contents. * @internal */ diff --git a/packages/openapi/src/openapi-request-builder.ts b/packages/openapi/src/openapi-request-builder.ts index 6a0313392f..113b75ce7d 100644 --- a/packages/openapi/src/openapi-request-builder.ts +++ b/packages/openapi/src/openapi-request-builder.ts @@ -40,7 +40,7 @@ export class OpenApiRequestBuilder { * @param method - HTTP method of the request to be built. * @param pathPattern - Path for the request containing path parameter references as in the OpenAPI specification. * @param parameters - Query parameters and or body to pass to the request. - * @param basePath - The path to be prefixed to the pathPattern. + * @param basePath - The custom path to be prefixed to the API path pattern. */ constructor( public method: Method, @@ -142,7 +142,7 @@ export class OpenApiRequestBuilder { } /** - * Set the basePath that gets prefixed to the pathPattern before a request. + * Set the custom base path that gets prefixed to the API path parameter before a request. * @param basePath - Base path to be set. * @returns The request builder itself, to facilitate method chaining. */ From fab2864ee8ec462b3b333248002bc22aacaea2d4 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 19 Dec 2024 09:29:57 +0100 Subject: [PATCH 57/59] chore:address review comments --- packages/openapi-generator/src/file-serializer/api-file.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/openapi-generator/src/file-serializer/api-file.spec.ts b/packages/openapi-generator/src/file-serializer/api-file.spec.ts index c139e0ae00..5676442524 100644 --- a/packages/openapi-generator/src/file-serializer/api-file.spec.ts +++ b/packages/openapi-generator/src/file-serializer/api-file.spec.ts @@ -130,7 +130,7 @@ describe('api-file', () => { multipleOperationApi, 'MyServiceName', undefined, - '/base/path/to/service/' + '/base/path/to/service' ) ).toMatchSnapshot(); }); From 29b0abdbe8485b72fe2fd9e761d82d659bc14435 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 19 Dec 2024 09:34:35 +0100 Subject: [PATCH 58/59] chore: address review comments --- .../src/file-serializer/__snapshots__/api-file.spec.ts.snap | 2 +- packages/openapi/src/openapi-request-builder.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap index 6925f7502f..0dca2d65be 100644 --- a/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap +++ b/packages/openapi-generator/src/file-serializer/__snapshots__/api-file.spec.ts.snap @@ -120,7 +120,7 @@ import type { QueryParameterType, RefType, ResponseType } from './schema'; * This API is part of the 'MyServiceName' service. */ export const TestApi = { - _defaultBasePath: '/base/path/to/service/', + _defaultBasePath: '/base/path/to/service', /** * Create a request builder for execution of get requests to the '/test/{id}' endpoint. * @param id - Path parameter. diff --git a/packages/openapi/src/openapi-request-builder.spec.ts b/packages/openapi/src/openapi-request-builder.spec.ts index 0fbf6fe77b..1a7d859a71 100644 --- a/packages/openapi/src/openapi-request-builder.spec.ts +++ b/packages/openapi/src/openapi-request-builder.spec.ts @@ -80,7 +80,7 @@ describe('openapi-request-builder', () => { const requestBuilder = new OpenApiRequestBuilder( 'get', '/test' - ).setBasePath('/base/path/to/service/'); + ).setBasePath('/base/path/to/service'); const response = await requestBuilder.executeRaw(destination); expect(httpClient.executeHttpRequest).toHaveBeenCalledWith( sanitizeDestination(destination), From b7af1d046fdeefecf6d231401b62bb07a6cfe8d9 Mon Sep 17 00:00:00 2001 From: i341658 Date: Thu, 19 Dec 2024 09:35:17 +0100 Subject: [PATCH 59/59] chore: release note fix --- .changeset/chilled-flowers-freeze.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/chilled-flowers-freeze.md b/.changeset/chilled-flowers-freeze.md index 16555b76f1..239800903d 100644 --- a/.changeset/chilled-flowers-freeze.md +++ b/.changeset/chilled-flowers-freeze.md @@ -2,4 +2,4 @@ '@sap-cloud-sdk/openapi': minor --- -[New Functionality] Introduce `setBasePath()` method on the OpenAPI request builder, allowing a custom base path URL to be set for a single request. This base path is prepended to the API path parameter for that request. +[New Functionality] Introduce `setBasePath()` method on the OpenAPI request builder, allowing a custom base path URL to be set for a single request. This base path is prepended to the API path parameter for that single request.