@@ -8,33 +8,36 @@ import type { QueryParameterType, RefType, ResponseType } from './schema/index.j
88 * This API is part of the 'MyServiceName' service.
99 */
1010export const TestApi = {
11+ _defaultBasePath : undefined ,
1112 /**
12- * Create a request builder for execution of get requests to the 'test/{id}' endpoint.
13+ * Create a request builder for execution of get requests to the '/ test/{id}' endpoint.
1314 * @param id - Path parameter.
1415 * @param queryParameters - Object containing the following keys: queryParam.
1516 * @param headerParameters - Object containing the following keys: headerParam.
1617 * @returns The request builder, use the \`execute()\` method to trigger the request.
1718 */
1819 getFn : (id : string , queryParameters : {' queryParam' : QueryParameterType }, headerParameters ? : {' headerParam' ? : string }) => new OpenApiRequestBuilder <string >(
1920 ' get' ,
20- " test/{id}" ,
21+ " / test/{id}" ,
2122 {
2223 pathParameters: { id },
2324 queryParameters ,
2425 headerParameters
25- }
26+ },
27+ TestApi ._defaultBasePath
2628 ),
2729 /**
28- * Create a request builder for execution of post requests to the 'test' endpoint.
30+ * Create a request builder for execution of post requests to the '/ test' endpoint.
2931 * @param body - Request body.
3032 * @returns The request builder, use the \`execute()\` method to trigger the request.
3133 */
3234 createFn : (body : RefType ) => new OpenApiRequestBuilder <ResponseType >(
3335 ' post' ,
34- " test" ,
36+ " / test" ,
3537 {
3638 body
37- }
39+ },
40+ TestApi ._defaultBasePath
3841 )
3942} ;"
4043` ;
@@ -46,13 +49,16 @@ exports[`api-file creates an api file with documentation 1`] = `
4649 * This API is part of the 'TestService' service.
4750 */
4851export const TestApi = {
52+ _defaultBasePath : undefined ,
4953 /**
50- * Create a request builder for execution of get requests to the 'test' endpoint.
54+ * Create a request builder for execution of get requests to the '/ test' endpoint.
5155 * @returns The request builder, use the \`execute()\` method to trigger the request.
5256 */
5357 getFn : () => new OpenApiRequestBuilder <any >(
5458 ' get' ,
55- " test"
59+ " /test" ,
60+ {},
61+ TestApi ._defaultBasePath
5662 )
5763} ;"
5864` ;
@@ -72,33 +78,78 @@ import type { QueryParameterType, RefType, ResponseType } from './schema';
7278 * This API is part of the 'MyServiceName' service.
7379 */
7480export const TestApi = {
81+ _defaultBasePath : undefined ,
7582 /**
76- * Create a request builder for execution of get requests to the 'test/{id}' endpoint.
83+ * Create a request builder for execution of get requests to the '/ test/{id}' endpoint.
7784 * @param id - Path parameter.
7885 * @param queryParameters - Object containing the following keys: queryParam.
7986 * @param headerParameters - Object containing the following keys: headerParam.
8087 * @returns The request builder, use the \`execute()\` method to trigger the request.
8188 */
8289 getFn : (id : string , queryParameters : {' queryParam' : QueryParameterType }, headerParameters ? : {' headerParam' ? : string }) => new OpenApiRequestBuilder <string >(
8390 ' get' ,
84- " test/{id}" ,
91+ " / test/{id}" ,
8592 {
8693 pathParameters: { id },
8794 queryParameters ,
8895 headerParameters
89- }
96+ },
97+ TestApi ._defaultBasePath
9098 ),
9199 /**
92- * Create a request builder for execution of post requests to the 'test' endpoint.
100+ * Create a request builder for execution of post requests to the '/ test' endpoint.
93101 * @param body - Request body.
94102 * @returns The request builder, use the \`execute()\` method to trigger the request.
95103 */
96104 createFn : (body : RefType ) => new OpenApiRequestBuilder <ResponseType >(
97105 ' post' ,
98- " test" ,
106+ " / test" ,
99107 {
100108 body
101- }
109+ },
110+ TestApi ._defaultBasePath
111+ )
112+ } ;"
113+ ` ;
114+
115+ exports [` api-file serializes api file with multiple operations and references and base path 1` ] = `
116+ "import { OpenApiRequestBuilder } from '@sap-cloud-sdk/openapi';
117+ import type { QueryParameterType , RefType , ResponseType } from './schema';
118+ /**
119+ * Representation of the 'TestApi'.
120+ * This API is part of the 'MyServiceName' service.
121+ */
122+ export const TestApi = {
123+ _defaultBasePath : ' /base/path/to/service' ,
124+ /**
125+ * Create a request builder for execution of get requests to the '/test/{id}' endpoint.
126+ * @param id - Path parameter.
127+ * @param queryParameters - Object containing the following keys: queryParam.
128+ * @param headerParameters - Object containing the following keys: headerParam.
129+ * @returns The request builder, use the \`execute()\` method to trigger the request.
130+ */
131+ getFn : (id : string , queryParameters : {' queryParam' : QueryParameterType }, headerParameters ? : {' headerParam' ? : string }) => new OpenApiRequestBuilder <string >(
132+ ' get' ,
133+ " /test/{id}" ,
134+ {
135+ pathParameters: { id },
136+ queryParameters ,
137+ headerParameters
138+ },
139+ TestApi ._defaultBasePath
140+ ),
141+ /**
142+ * Create a request builder for execution of post requests to the '/test' endpoint.
143+ * @param body - Request body.
144+ * @returns The request builder, use the \`execute()\` method to trigger the request.
145+ */
146+ createFn : (body : RefType ) => new OpenApiRequestBuilder <ResponseType >(
147+ ' post' ,
148+ " /test" ,
149+ {
150+ body
151+ },
152+ TestApi ._defaultBasePath
102153 )
103154} ;"
104155` ;
@@ -110,17 +161,19 @@ exports[`api-file serializes api file with one operation and no references 1`] =
110161 * This API is part of the 'MyServiceName' service.
111162 */
112163export const TestApi = {
164+ _defaultBasePath : undefined ,
113165 /**
114- * Create a request builder for execution of get requests to the 'test/{id}' endpoint.
166+ * Create a request builder for execution of get requests to the '/ test/{id}' endpoint.
115167 * @param id - Path parameter.
116168 * @returns The request builder, use the \`execute()\` method to trigger the request.
117169 */
118170 getFn : (id : string ) => new OpenApiRequestBuilder <any >(
119171 ' get' ,
120- " test/{id}" ,
172+ " / test/{id}" ,
121173 {
122174 pathParameters: { id }
123- }
175+ },
176+ TestApi ._defaultBasePath
124177 )
125178} ;"
126179` ;
0 commit comments