diff --git a/bin/configs/typescript-fetch-infinite-recursion-issue.yaml b/bin/configs/typescript-fetch-infinite-recursion-issue.yaml new file mode 100644 index 000000000000..d8882b00031b --- /dev/null +++ b/bin/configs/typescript-fetch-infinite-recursion-issue.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-fetch +outputDir: samples/client/others/typescript-fetch/infinite-recursion-issue +inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +additionalProperties: + enumPropertyNaming: "original" + enumUnknownDefaultCase: true diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index a5233738ace1..ca0a19a621d9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -1605,11 +1605,13 @@ public ExtendedCodegenModel(CodegenModel cm) { if (this.discriminator != null) { Set mappedModels = this.discriminator.getMappedModels(); for(CodegenDiscriminator.MappedModel mappedModel : mappedModels) { - if(mappedModel.getModelName().equals(cm.classname)){ - this.discriminator.getMappedModels().remove(mappedModel); - this.selfReferencingDiscriminatorMapping=mappedModel; + if(mappedModel.getModelName().equals(cm.classname)) { + this.selfReferencingDiscriminatorMapping = mappedModel; } } + if(this.selfReferencingDiscriminatorMapping != null) { + this.discriminator.getMappedModels().remove(this.selfReferencingDiscriminatorMapping); + } } } diff --git a/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml new file mode 100644 index 000000000000..e4f13aebad6f --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml @@ -0,0 +1,53 @@ +openapi: 3.0.3 +info: + title: Minimal + description: Api to reproduce bug + version: 0.5.1-SNAPSHOT.0 +tags: + - name: test +servers: + - url: http://localhost:8080 +paths: + /api/v1/test: + get: + tags: + - test + operationId: test + responses: + "200": + description: test operation + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TestBaseDto" + +components: + schemas: + TestObjectType: + type: string + enum: + - TEST1 + - TEST2 + TestBaseDto: + type: object + properties: + something: + type: string + testObjectType: + $ref: "#/components/schemas/TestObjectType" + discriminator: + propertyName: testObjectType + mapping: + TEST2: '#/components/schemas/ExtendDto' + TEST1: '#/components/schemas/TestBaseDto' + ExtendDto: + allOf: + - $ref: '#/components/schemas/TestBaseDto' + - type: object + properties: + someItems: + type: array + items: + $ref: '#/components/schemas/TestBaseDto' \ No newline at end of file diff --git a/samples/client/echo_api/typescript/build/.openapi-generator/FILES b/samples/client/echo_api/typescript/build/.openapi-generator/FILES index 4db34aea13ac..cf34609e407f 100644 --- a/samples/client/echo_api/typescript/build/.openapi-generator/FILES +++ b/samples/client/echo_api/typescript/build/.openapi-generator/FILES @@ -1,11 +1,5 @@ .gitattributes .gitignore -AuthApi.md -BodyApi.md -FormApi.md -HeaderApi.md -PathApi.md -QueryApi.md README.md apis/AuthApi.ts apis/BodyApi.ts @@ -17,6 +11,12 @@ apis/baseapi.ts apis/exception.ts auth/auth.ts configuration.ts +docs/AuthApi.md +docs/BodyApi.md +docs/FormApi.md +docs/HeaderApi.md +docs/PathApi.md +docs/QueryApi.md git_push.sh http/http.ts http/isomorphic-fetch.ts diff --git a/samples/client/echo_api/typescript/build/docs/AuthApi.md b/samples/client/echo_api/typescript/build/docs/AuthApi.md new file mode 100644 index 000000000000..349a5adaa7e8 --- /dev/null +++ b/samples/client/echo_api/typescript/build/docs/AuthApi.md @@ -0,0 +1,103 @@ +# .AuthApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testAuthHttpBasic**](AuthApi.md#testAuthHttpBasic) | **POST** /auth/http/basic | To test HTTP basic authentication +[**testAuthHttpBearer**](AuthApi.md#testAuthHttpBearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication + + +# **testAuthHttpBasic** +> string testAuthHttpBasic() + +To test HTTP basic authentication + +### Example + + +```typescript +import { createConfiguration, AuthApi } from ''; + +const configuration = createConfiguration(); +const apiInstance = new AuthApi(configuration); + +const request = {}; + +const data = await apiInstance.testAuthHttpBasic(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +**string** + +### Authorization + +[http_auth](README.md#http_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testAuthHttpBearer** +> string testAuthHttpBearer() + +To test HTTP bearer authentication + +### Example + + +```typescript +import { createConfiguration, AuthApi } from ''; + +const configuration = createConfiguration(); +const apiInstance = new AuthApi(configuration); + +const request = {}; + +const data = await apiInstance.testAuthHttpBearer(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +**string** + +### Authorization + +[http_bearer_auth](README.md#http_bearer_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/client/echo_api/typescript/build/docs/BodyApi.md b/samples/client/echo_api/typescript/build/docs/BodyApi.md new file mode 100644 index 000000000000..182218637c70 --- /dev/null +++ b/samples/client/echo_api/typescript/build/docs/BodyApi.md @@ -0,0 +1,581 @@ +# .BodyApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body +[**testBodyApplicationOctetstreamBinary**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) +[**testBodyMultipartFormdataArrayOfBinary**](BodyApi.md#testBodyMultipartFormdataArrayOfBinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime +[**testBodyMultipartFormdataSingleBinary**](BodyApi.md#testBodyMultipartFormdataSingleBinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime +[**testEchoBodyAllOfPet**](BodyApi.md#testEchoBodyAllOfPet) | **POST** /echo/body/allOf/Pet | Test body parameter(s) +[**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object +[**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) +[**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body +[**testEchoBodyStringEnum**](BodyApi.md#testEchoBodyStringEnum) | **POST** /echo/body/string_enum | Test string enum response body +[**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) + + +# **testBinaryGif** +> HttpFile testBinaryGif() + +Test binary (gif) response body + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request = {}; + +const data = await apiInstance.testBinaryGif(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +**HttpFile** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/gif + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testBodyApplicationOctetstreamBinary** +> string testBodyApplicationOctetstreamBinary() + +Test body parameter(s) + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestBodyApplicationOctetstreamBinaryRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestBodyApplicationOctetstreamBinaryRequest = { + + body: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, +}; + +const data = await apiInstance.testBodyApplicationOctetstreamBinary(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **HttpFile**| | + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testBodyMultipartFormdataArrayOfBinary** +> string testBodyMultipartFormdataArrayOfBinary() + +Test array of binary in multipart mime + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestBodyMultipartFormdataArrayOfBinaryRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestBodyMultipartFormdataArrayOfBinaryRequest = { + + files: [ + { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, + ], +}; + +const data = await apiInstance.testBodyMultipartFormdataArrayOfBinary(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **files** | **Array<HttpFile>** | | defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testBodyMultipartFormdataSingleBinary** +> string testBodyMultipartFormdataSingleBinary() + +Test single binary in multipart mime + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestBodyMultipartFormdataSingleBinaryRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestBodyMultipartFormdataSingleBinaryRequest = { + + myFile: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, +}; + +const data = await apiInstance.testBodyMultipartFormdataSingleBinary(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **myFile** | [**HttpFile**] | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEchoBodyAllOfPet** +> Pet testEchoBodyAllOfPet() + +Test body parameter(s) + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestEchoBodyAllOfPetRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestEchoBodyAllOfPetRequest = { + // Pet object that needs to be added to the store (optional) + pet: null, +}; + +const data = await apiInstance.testEchoBodyAllOfPet(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | **Pet**| Pet object that needs to be added to the store | + + +### Return type + +**Pet** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEchoBodyFreeFormObjectResponseString** +> string testEchoBodyFreeFormObjectResponseString() + +Test free form object + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestEchoBodyFreeFormObjectResponseStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestEchoBodyFreeFormObjectResponseStringRequest = { + // Free form object (optional) + body: {}, +}; + +const data = await apiInstance.testEchoBodyFreeFormObjectResponseString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **any**| Free form object | + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEchoBodyPet** +> Pet testEchoBodyPet() + +Test body parameter(s) + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestEchoBodyPetRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestEchoBodyPetRequest = { + // Pet object that needs to be added to the store (optional) + pet: { + id: 10, + name: "doggie", + category: { + id: 1, + name: "Dogs", + }, + photoUrls: [ + "photoUrls_example", + ], + tags: [ + { + id: 1, + name: "name_example", + }, + ], + status: "available", + }, +}; + +const data = await apiInstance.testEchoBodyPet(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | **Pet**| Pet object that needs to be added to the store | + + +### Return type + +**Pet** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEchoBodyPetResponseString** +> string testEchoBodyPetResponseString() + +Test empty response body + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestEchoBodyPetResponseStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestEchoBodyPetResponseStringRequest = { + // Pet object that needs to be added to the store (optional) + pet: { + id: 10, + name: "doggie", + category: { + id: 1, + name: "Dogs", + }, + photoUrls: [ + "photoUrls_example", + ], + tags: [ + { + id: 1, + name: "name_example", + }, + ], + status: "available", + }, +}; + +const data = await apiInstance.testEchoBodyPetResponseString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | **Pet**| Pet object that needs to be added to the store | + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEchoBodyStringEnum** +> StringEnumRef testEchoBodyStringEnum() + +Test string enum response body + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestEchoBodyStringEnumRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestEchoBodyStringEnumRequest = { + // String enum (optional) + body: "success", +}; + +const data = await apiInstance.testEchoBodyStringEnum(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **string**| String enum | + + +### Return type + +**StringEnumRef** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEchoBodyTagResponseString** +> string testEchoBodyTagResponseString() + +Test empty json (request body) + +### Example + + +```typescript +import { createConfiguration, BodyApi } from ''; +import type { BodyApiTestEchoBodyTagResponseStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new BodyApi(configuration); + +const request: BodyApiTestEchoBodyTagResponseStringRequest = { + // Tag object (optional) + tag: { + id: 1, + name: "name_example", + }, +}; + +const data = await apiInstance.testEchoBodyTagResponseString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag** | **Tag**| Tag object | + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/client/echo_api/typescript/build/docs/FormApi.md b/samples/client/echo_api/typescript/build/docs/FormApi.md new file mode 100644 index 000000000000..f29d546be6e5 --- /dev/null +++ b/samples/client/echo_api/typescript/build/docs/FormApi.md @@ -0,0 +1,194 @@ +# .FormApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) +[**testFormObjectMultipart**](FormApi.md#testFormObjectMultipart) | **POST** /form/object/multipart | Test form parameter(s) for multipart schema +[**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema + + +# **testFormIntegerBooleanString** +> string testFormIntegerBooleanString() + +Test form parameter(s) + +### Example + + +```typescript +import { createConfiguration, FormApi } from ''; +import type { FormApiTestFormIntegerBooleanStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new FormApi(configuration); + +const request: FormApiTestFormIntegerBooleanStringRequest = { + + integerForm: 1, + + booleanForm: true, + + stringForm: "stringForm_example", +}; + +const data = await apiInstance.testFormIntegerBooleanString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerForm** | [**number**] | | (optional) defaults to undefined + **booleanForm** | [**boolean**] | | (optional) defaults to undefined + **stringForm** | [**string**] | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testFormObjectMultipart** +> string testFormObjectMultipart() + +Test form parameter(s) for multipart schema + +### Example + + +```typescript +import { createConfiguration, FormApi } from ''; +import type { FormApiTestFormObjectMultipartRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new FormApi(configuration); + +const request: FormApiTestFormObjectMultipartRequest = { + + marker: { + name: "name_example", + }, +}; + +const data = await apiInstance.testFormObjectMultipart(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **marker** | **TestFormObjectMultipartRequestMarker** | | defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testFormOneof** +> string testFormOneof() + +Test form parameter(s) for oneOf schema + +### Example + + +```typescript +import { createConfiguration, FormApi } from ''; +import type { FormApiTestFormOneofRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new FormApi(configuration); + +const request: FormApiTestFormOneofRequest = { + + form1: "form1_example", + + form2: 1, + + form3: "form3_example", + + form4: true, + + id: 1, + + name: "name_example", +}; + +const data = await apiInstance.testFormOneof(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **form1** | [**string**] | | (optional) defaults to undefined + **form2** | [**number**] | | (optional) defaults to undefined + **form3** | [**string**] | | (optional) defaults to undefined + **form4** | [**boolean**] | | (optional) defaults to undefined + **id** | [**number**] | | (optional) defaults to undefined + **name** | [**string**] | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/client/echo_api/typescript/build/docs/HeaderApi.md b/samples/client/echo_api/typescript/build/docs/HeaderApi.md new file mode 100644 index 000000000000..01a5d81dee44 --- /dev/null +++ b/samples/client/echo_api/typescript/build/docs/HeaderApi.md @@ -0,0 +1,75 @@ +# .HeaderApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testHeaderIntegerBooleanStringEnums**](HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) + + +# **testHeaderIntegerBooleanStringEnums** +> string testHeaderIntegerBooleanStringEnums() + +Test header parameter(s) + +### Example + + +```typescript +import { createConfiguration, HeaderApi } from ''; +import type { HeaderApiTestHeaderIntegerBooleanStringEnumsRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new HeaderApi(configuration); + +const request: HeaderApiTestHeaderIntegerBooleanStringEnumsRequest = { + + integerHeader: 1, + + booleanHeader: true, + + stringHeader: "string_header_example", + + enumNonrefStringHeader: "success", + + enumRefStringHeader: "success", +}; + +const data = await apiInstance.testHeaderIntegerBooleanStringEnums(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerHeader** | [**number**] | | (optional) defaults to undefined + **booleanHeader** | [**boolean**] | | (optional) defaults to undefined + **stringHeader** | [**string**] | | (optional) defaults to undefined + **enumNonrefStringHeader** | [**'success' | 'failure' | 'unclassified'**]**Array<'success' | 'failure' | 'unclassified'>** | | (optional) defaults to undefined + **enumRefStringHeader** | **StringEnumRef** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/client/echo_api/typescript/build/docs/PathApi.md b/samples/client/echo_api/typescript/build/docs/PathApi.md new file mode 100644 index 000000000000..10ed995105b4 --- /dev/null +++ b/samples/client/echo_api/typescript/build/docs/PathApi.md @@ -0,0 +1,72 @@ +# .PathApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) + + +# **testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath** +> string testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath() + +Test path parameter(s) + +### Example + + +```typescript +import { createConfiguration, PathApi } from ''; +import type { PathApiTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new PathApi(configuration); + +const request: PathApiTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequest = { + + pathString: "path_string_example", + + pathInteger: 1, + + enumNonrefStringPath: "success", + + enumRefStringPath: "success", +}; + +const data = await apiInstance.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pathString** | [**string**] | | defaults to undefined + **pathInteger** | [**number**] | | defaults to undefined + **enumNonrefStringPath** | [**'success' | 'failure' | 'unclassified'**]**Array<'success' | 'failure' | 'unclassified'>** | | defaults to undefined + **enumRefStringPath** | **StringEnumRef** | | defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/client/echo_api/typescript/build/docs/QueryApi.md b/samples/client/echo_api/typescript/build/docs/QueryApi.md new file mode 100644 index 000000000000..15d6880888b3 --- /dev/null +++ b/samples/client/echo_api/typescript/build/docs/QueryApi.md @@ -0,0 +1,659 @@ +# .QueryApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deprecatedTest**](QueryApi.md#deprecatedTest) | **GET** /test/deprecated | Test deprecation +[**testEnumRefString**](QueryApi.md#testEnumRefString) | **GET** /query/enum_ref_string | Test query parameter(s) +[**testQueryDatetimeDateString**](QueryApi.md#testQueryDatetimeDateString) | **GET** /query/datetime/date/string | Test query parameter(s) +[**testQueryIntegerBooleanString**](QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s) +[**testQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) +[**testQueryStyleDeepObjectExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObjectAllOf) | **GET** /query/style_deepObject/explode_true/object/allOf | Test query parameter(s) +[**testQueryStyleFormExplodeFalseArrayInteger**](QueryApi.md#testQueryStyleFormExplodeFalseArrayInteger) | **GET** /query/style_form/explode_false/array_integer | Test query parameter(s) +[**testQueryStyleFormExplodeFalseArrayString**](QueryApi.md#testQueryStyleFormExplodeFalseArrayString) | **GET** /query/style_form/explode_false/array_string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) +[**testQueryStyleFormExplodeTrueObjectAllOf**](QueryApi.md#testQueryStyleFormExplodeTrueObjectAllOf) | **GET** /query/style_form/explode_true/object/allOf | Test query parameter(s) + + +# **deprecatedTest** +> string deprecatedTest() + + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiDeprecatedTestRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiDeprecatedTestRequest = { + // name of pet (optional) + name: "name_example", +}; + +const data = await apiInstance.deprecatedTest(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | [**string**] | name of pet | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEnumRefString** +> string testEnumRefString() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestEnumRefStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestEnumRefStringRequest = { + + enumNonrefStringQuery: "success", + + enumRefStringQuery: "success", +}; + +const data = await apiInstance.testEnumRefString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumNonrefStringQuery** | [**'success' | 'failure' | 'unclassified'**]**Array<'success' | 'failure' | 'unclassified'>** | | (optional) defaults to undefined + **enumRefStringQuery** | **StringEnumRef** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryDatetimeDateString** +> string testQueryDatetimeDateString() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryDatetimeDateStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryDatetimeDateStringRequest = { + + datetimeQuery: new Date('1970-01-01T00:00:00.00Z'), + + dateQuery: new Date('1970-01-01').toISOString().split('T')[0];, + + stringQuery: "string_query_example", +}; + +const data = await apiInstance.testQueryDatetimeDateString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **datetimeQuery** | [**Date**] | | (optional) defaults to undefined + **dateQuery** | [**string**] | | (optional) defaults to undefined + **stringQuery** | [**string**] | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryIntegerBooleanString** +> string testQueryIntegerBooleanString() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryIntegerBooleanStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryIntegerBooleanStringRequest = { + + integerQuery: 1, + + booleanQuery: true, + + stringQuery: "string_query_example", +}; + +const data = await apiInstance.testQueryIntegerBooleanString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerQuery** | [**number**] | | (optional) defaults to undefined + **booleanQuery** | [**boolean**] | | (optional) defaults to undefined + **stringQuery** | [**string**] | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryStyleDeepObjectExplodeTrueObject** +> string testQueryStyleDeepObjectExplodeTrueObject() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryStyleDeepObjectExplodeTrueObjectRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryStyleDeepObjectExplodeTrueObjectRequest = { + + queryObject: { + id: 10, + name: "doggie", + category: { + id: 1, + name: "Dogs", + }, + photoUrls: [ + "photoUrls_example", + ], + tags: [ + { + id: 1, + name: "name_example", + }, + ], + status: "available", + }, +}; + +const data = await apiInstance.testQueryStyleDeepObjectExplodeTrueObject(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | **Pet** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryStyleDeepObjectExplodeTrueObjectAllOf** +> string testQueryStyleDeepObjectExplodeTrueObjectAllOf() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryStyleDeepObjectExplodeTrueObjectAllOfRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryStyleDeepObjectExplodeTrueObjectAllOfRequest = { + + queryObject: null, +}; + +const data = await apiInstance.testQueryStyleDeepObjectExplodeTrueObjectAllOf(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | **TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryStyleFormExplodeFalseArrayInteger** +> string testQueryStyleFormExplodeFalseArrayInteger() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryStyleFormExplodeFalseArrayIntegerRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryStyleFormExplodeFalseArrayIntegerRequest = { + + queryObject: [ + 1, + ], +}; + +const data = await apiInstance.testQueryStyleFormExplodeFalseArrayInteger(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | **Array<number>** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryStyleFormExplodeFalseArrayString** +> string testQueryStyleFormExplodeFalseArrayString() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryStyleFormExplodeFalseArrayStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryStyleFormExplodeFalseArrayStringRequest = { + + queryObject: [ + "query_object_example", + ], +}; + +const data = await apiInstance.testQueryStyleFormExplodeFalseArrayString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | **Array<string>** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryStyleFormExplodeTrueArrayString** +> string testQueryStyleFormExplodeTrueArrayString() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryStyleFormExplodeTrueArrayStringRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryStyleFormExplodeTrueArrayStringRequest = { + + queryObject: { + values: [ + "values_example", + ], + }, +}; + +const data = await apiInstance.testQueryStyleFormExplodeTrueArrayString(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | **TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryStyleFormExplodeTrueObject** +> string testQueryStyleFormExplodeTrueObject() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryStyleFormExplodeTrueObjectRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryStyleFormExplodeTrueObjectRequest = { + + queryObject: { + id: 10, + name: "doggie", + category: { + id: 1, + name: "Dogs", + }, + photoUrls: [ + "photoUrls_example", + ], + tags: [ + { + id: 1, + name: "name_example", + }, + ], + status: "available", + }, +}; + +const data = await apiInstance.testQueryStyleFormExplodeTrueObject(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | **Pet** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryStyleFormExplodeTrueObjectAllOf** +> string testQueryStyleFormExplodeTrueObjectAllOf() + +Test query parameter(s) + +### Example + + +```typescript +import { createConfiguration, QueryApi } from ''; +import type { QueryApiTestQueryStyleFormExplodeTrueObjectAllOfRequest } from ''; + +const configuration = createConfiguration(); +const apiInstance = new QueryApi(configuration); + +const request: QueryApiTestQueryStyleFormExplodeTrueObjectAllOfRequest = { + + queryObject: null, +}; + +const data = await apiInstance.testQueryStyleFormExplodeTrueObjectAllOf(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | **DataQuery** | | (optional) defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator-ignore b/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator/FILES b/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator/FILES new file mode 100644 index 000000000000..d352b9be64c8 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator/FILES @@ -0,0 +1,8 @@ +apis/TestApi.ts +apis/index.ts +index.ts +models/ExtendDto.ts +models/TestBaseDto.ts +models/TestObjectType.ts +models/index.ts +runtime.ts diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator/VERSION b/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator/VERSION new file mode 100644 index 000000000000..9e0e9bce84b2 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.17.0-SNAPSHOT diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/apis/TestApi.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/apis/TestApi.ts new file mode 100644 index 000000000000..ba47bcab5145 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/apis/TestApi.ts @@ -0,0 +1,57 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Minimal + * Api to reproduce bug + * + * The version of the OpenAPI document: 0.5.1-SNAPSHOT.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + TestBaseDto, +} from '../models/index'; +import { + TestBaseDtoFromJSON, + TestBaseDtoToJSON, +} from '../models/index'; + +/** + * + */ +export class TestApi extends runtime.BaseAPI { + + /** + */ + async testRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/api/v1/test`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TestBaseDtoFromJSON)); + } + + /** + */ + async test(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.testRaw(initOverrides); + return await response.value(); + } + +} diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/apis/index.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/apis/index.ts new file mode 100644 index 000000000000..8d61bc15da62 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/apis/index.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './TestApi'; diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/index.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/index.ts new file mode 100644 index 000000000000..bebe8bbbe206 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/models/ExtendDto.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/ExtendDto.ts new file mode 100644 index 000000000000..d9087a0312e4 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/ExtendDto.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Minimal + * Api to reproduce bug + * + * The version of the OpenAPI document: 0.5.1-SNAPSHOT.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TestBaseDto } from './TestBaseDto'; +import { + TestBaseDtoFromJSON, + TestBaseDtoFromJSONTyped, + TestBaseDtoToJSON, + TestBaseDtoToJSONTyped, +} from './TestBaseDto'; +import type { TestObjectType } from './TestObjectType'; +import { + TestObjectTypeFromJSON, + TestObjectTypeFromJSONTyped, + TestObjectTypeToJSON, + TestObjectTypeToJSONTyped, +} from './TestObjectType'; + +/** + * + * @export + * @interface ExtendDto + */ +export interface ExtendDto extends TestBaseDto { + /** + * + * @type {Array} + * @memberof ExtendDto + */ + someItems?: Array; +} + + + +/** + * Check if a given object implements the ExtendDto interface. + */ +export function instanceOfExtendDto(value: object): value is ExtendDto { + return true; +} + +export function ExtendDtoFromJSON(json: any): ExtendDto { + return ExtendDtoFromJSONTyped(json, false); +} + +export function ExtendDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExtendDto { + if (json == null) { + return json; + } + return { + ...TestBaseDtoFromJSONTyped(json, true), + 'someItems': json['someItems'] == null ? undefined : ((json['someItems'] as Array).map(TestBaseDtoFromJSON)), + }; +} + +export function ExtendDtoToJSON(json: any): ExtendDto { + return ExtendDtoToJSONTyped(json, false); +} + +export function ExtendDtoToJSONTyped(value?: ExtendDto | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + ...TestBaseDtoToJSONTyped(value, true), + 'someItems': value['someItems'] == null ? undefined : ((value['someItems'] as Array).map(TestBaseDtoToJSON)), + }; +} + diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestBaseDto.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestBaseDto.ts new file mode 100644 index 000000000000..c887a59dd2e4 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestBaseDto.ts @@ -0,0 +1,102 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Minimal + * Api to reproduce bug + * + * The version of the OpenAPI document: 0.5.1-SNAPSHOT.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { TestObjectType } from './TestObjectType'; +import { + TestObjectTypeFromJSON, + TestObjectTypeFromJSONTyped, + TestObjectTypeToJSON, + TestObjectTypeToJSONTyped, +} from './TestObjectType'; + +import { type ExtendDto, ExtendDtoFromJSONTyped, ExtendDtoToJSON, ExtendDtoToJSONTyped } from './ExtendDto'; +/** + * + * @export + * @interface TestBaseDto + */ +export interface TestBaseDto { + /** + * + * @type {string} + * @memberof TestBaseDto + */ + something?: string; + /** + * + * @type {TestObjectType} + * @memberof TestBaseDto + */ + testObjectType?: TestObjectType; +} + + + +/** + * Check if a given object implements the TestBaseDto interface. + */ +export function instanceOfTestBaseDto(value: object): value is TestBaseDto { + return true; +} + +export function TestBaseDtoFromJSON(json: any): TestBaseDto { + return TestBaseDtoFromJSONTyped(json, false); +} + +export function TestBaseDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestBaseDto { + if (json == null) { + return json; + } + if (!ignoreDiscriminator) { + if (json['testObjectType'] === 'TEST2') { + return ExtendDtoFromJSONTyped(json, ignoreDiscriminator); + } + if (json['testObjectType'] === 'TEST1') { + return TestBaseDtoFromJSONTyped(json, true); + } + + } + return { + + 'something': json['something'] == null ? undefined : json['something'], + 'testObjectType': json['testObjectType'] == null ? undefined : TestObjectTypeFromJSON(json['testObjectType']), + }; +} + +export function TestBaseDtoToJSON(json: any): TestBaseDto { + return TestBaseDtoToJSONTyped(json, false); +} + +export function TestBaseDtoToJSONTyped(value?: TestBaseDto | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + if (!ignoreDiscriminator) { + switch (value['testObjectType']) { + case 'TEST2': + return ExtendDtoToJSONTyped(value as ExtendDto, ignoreDiscriminator); + default: + return value; + } + } + + return { + + 'something': value['something'], + 'testObjectType': TestObjectTypeToJSON(value['testObjectType']), + }; +} + diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestObjectType.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestObjectType.ts new file mode 100644 index 000000000000..f3fc7cdfe944 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestObjectType.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Minimal + * Api to reproduce bug + * + * The version of the OpenAPI document: 0.5.1-SNAPSHOT.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const TestObjectType = { + TEST1: 'TEST1', + TEST2: 'TEST2', + unknown_default_open_api: '11184809' +} as const; +export type TestObjectType = typeof TestObjectType[keyof typeof TestObjectType]; + + +export function instanceOfTestObjectType(value: any): boolean { + for (const key in TestObjectType) { + if (Object.prototype.hasOwnProperty.call(TestObjectType, key)) { + if (TestObjectType[key as keyof typeof TestObjectType] === value) { + return true; + } + } + } + return false; +} + +export function TestObjectTypeFromJSON(json: any): TestObjectType { + return TestObjectTypeFromJSONTyped(json, false); +} + +export function TestObjectTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestObjectType { + return json as TestObjectType; +} + +export function TestObjectTypeToJSON(value?: TestObjectType | null): any { + return value as any; +} + +export function TestObjectTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): TestObjectType { + return value as TestObjectType; +} + diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/models/index.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/index.ts new file mode 100644 index 000000000000..d9506396414d --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/models/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './ExtendDto'; +export * from './TestBaseDto'; +export * from './TestObjectType'; diff --git a/samples/client/others/typescript-fetch/infinite-recursion-issue/runtime.ts b/samples/client/others/typescript-fetch/infinite-recursion-issue/runtime.ts new file mode 100644 index 000000000000..492083e7c372 --- /dev/null +++ b/samples/client/others/typescript-fetch/infinite-recursion-issue/runtime.ts @@ -0,0 +1,432 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Minimal + * Api to reproduce bug + * + * The version of the OpenAPI document: 0.5.1-SNAPSHOT.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const BASE_PATH = "http://localhost:8080".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw new ResponseError(response, 'Response returned an error code'); + } + + private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) { + let url = this.configuration.basePath + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign({}, this.configuration.headers, context.headers); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })) + }; + + let body: any; + if (isFormData(overriddenInit.body) + || (overriddenInit.body instanceof URLSearchParams) + || isBlob(overriddenInit.body)) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function mapValues(data: any, fn: (item: any) => any) { + const result: { [key: string]: any } = {}; + for (const key of Object.keys(data)) { + result[key] = fn(data[key]); + } + return result; +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} diff --git a/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts b/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts index fda9bb25bb6e..436a1392ab77 100644 --- a/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts +++ b/samples/client/others/typescript-fetch/self-import-issue/models/AbstractUserDto.ts @@ -71,6 +71,7 @@ export function AbstractUserDtoFromJSONTyped(json: any, ignoreDiscriminator: boo if (json['type'] === 'remote-authenticated') { return RemoteAuthenticatedUserDtoFromJSONTyped(json, ignoreDiscriminator); } + } return { diff --git a/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES index e770a65f9adc..e3f6f9a55b0f 100644 --- a/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES +++ b/samples/client/others/typescript/builds/with-unique-items/.openapi-generator/FILES @@ -1,12 +1,12 @@ .gitattributes .gitignore -DefaultApi.md README.md apis/DefaultApi.ts apis/baseapi.ts apis/exception.ts auth/auth.ts configuration.ts +docs/DefaultApi.md git_push.sh http/http.ts http/isomorphic-fetch.ts diff --git a/samples/client/others/typescript/encode-decode/build/.openapi-generator/FILES b/samples/client/others/typescript/encode-decode/build/.openapi-generator/FILES index b8c07c76c070..f68e16b7d191 100644 --- a/samples/client/others/typescript/encode-decode/build/.openapi-generator/FILES +++ b/samples/client/others/typescript/encode-decode/build/.openapi-generator/FILES @@ -1,12 +1,12 @@ .gitattributes .gitignore -DefaultApi.md README.md apis/DefaultApi.ts apis/baseapi.ts apis/exception.ts auth/auth.ts configuration.ts +docs/DefaultApi.md git_push.sh http/http.ts http/isomorphic-fetch.ts diff --git a/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts b/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts index e69de29bb2d1..d7263e3d719b 100644 --- a/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts +++ b/samples/client/others/typescript/encode-decode/build/types/ObjectParamAPI.ts @@ -0,0 +1,658 @@ +import { ResponseContext, RequestContext, HttpFile, HttpInfo } from '../http/http'; +import { Configuration, ConfigurationOptions } from '../configuration' +import type { Middleware } from '../middleware'; + +import { ComplexObject } from '../models/ComplexObject'; +import { CompositeObject } from '../models/CompositeObject'; + +import { ObservableDefaultApi } from "./ObservableAPI"; +import { DefaultApiRequestFactory, DefaultApiResponseProcessor} from "../apis/DefaultApi"; + +export interface DefaultApiTestDecodeArrayOfArraysGetRequest { +} + +export interface DefaultApiTestDecodeArrayOfGetRequest { +} + +export interface DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest { +} + +export interface DefaultApiTestDecodeArrayOfNullableGetRequest { +} + +export interface DefaultApiTestDecodeArrayOfNullableObjectsGetRequest { +} + +export interface DefaultApiTestDecodeCompositeObjectsGetRequest { +} + +export interface DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest { +} + +export interface DefaultApiTestDecodeMapOfObjectsGetRequest { +} + +export interface DefaultApiTestDecodeMapOfPrimitiveGetRequest { +} + +export interface DefaultApiTestDecodeNullableArrayGetRequest { +} + +export interface DefaultApiTestDecodeNullableGetRequest { +} + +export interface DefaultApiTestDecodeObjectGetRequest { +} + +export interface DefaultApiTestDecodePrimitiveBooleanGetRequest { +} + +export interface DefaultApiTestDecodePrimitiveIntegerGetRequest { +} + +export interface DefaultApiTestDecodePrimitiveNumberGetRequest { +} + +export interface DefaultApiTestDecodePrimitiveStringGetRequest { +} + +export interface DefaultApiTestEncodeArrayOfArraysPostRequest { + /** + * + * @type Array<Array<string>> + * @memberof DefaultApitestEncodeArrayOfArraysPost + */ + requestBody: Array> +} + +export interface DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest { + /** + * + * @type Array<{ [key: string]: ComplexObject; }> + * @memberof DefaultApitestEncodeArrayOfMapsOfObjectsPost + */ + complexObject: Array<{ [key: string]: ComplexObject; }> +} + +export interface DefaultApiTestEncodeArrayOfNullableObjectsPostRequest { + /** + * + * @type Array<ComplexObject> + * @memberof DefaultApitestEncodeArrayOfNullableObjectsPost + */ + complexObject: Array +} + +export interface DefaultApiTestEncodeArrayOfNullablePostRequest { + /** + * + * @type Array<string | null> + * @memberof DefaultApitestEncodeArrayOfNullablePost + */ + requestBody: Array +} + +export interface DefaultApiTestEncodeArrayOfPostRequest { + /** + * + * @type Array<string> + * @memberof DefaultApitestEncodeArrayOfPost + */ + requestBody: Array +} + +export interface DefaultApiTestEncodeCompositeObjectsPostRequest { + /** + * + * @type CompositeObject + * @memberof DefaultApitestEncodeCompositeObjectsPost + */ + compositeObject: CompositeObject +} + +export interface DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest { + /** + * + * @type { [key: string]: { [key: string]: ComplexObject; }; } + * @memberof DefaultApitestEncodeMapOfMapsOfObjectsPost + */ + requestBody: { [key: string]: { [key: string]: ComplexObject; }; } +} + +export interface DefaultApiTestEncodeMapOfObjectsPostRequest { + /** + * + * @type { [key: string]: ComplexObject | null; } + * @memberof DefaultApitestEncodeMapOfObjectsPost + */ + requestBody: { [key: string]: ComplexObject | null; } +} + +export interface DefaultApiTestEncodeMapOfPrimitivePostRequest { + /** + * + * @type { [key: string]: string; } + * @memberof DefaultApitestEncodeMapOfPrimitivePost + */ + requestBody: { [key: string]: string; } +} + +export interface DefaultApiTestEncodeNullableArrayPostRequest { + /** + * + * @type Array<string> + * @memberof DefaultApitestEncodeNullableArrayPost + */ + requestBody?: Array +} + +export interface DefaultApiTestEncodeNullablePostRequest { + /** + * + * @type string + * @memberof DefaultApitestEncodeNullablePost + */ + body?: string +} + +export interface DefaultApiTestEncodeObjectPostRequest { + /** + * + * @type ComplexObject + * @memberof DefaultApitestEncodeObjectPost + */ + complexObject: ComplexObject +} + +export interface DefaultApiTestEncodePrimitiveBooleanPostRequest { + /** + * + * @type boolean + * @memberof DefaultApitestEncodePrimitiveBooleanPost + */ + body: boolean +} + +export interface DefaultApiTestEncodePrimitiveIntegerPostRequest { + /** + * + * @type number + * @memberof DefaultApitestEncodePrimitiveIntegerPost + */ + body: number +} + +export interface DefaultApiTestEncodePrimitiveNumberPostRequest { + /** + * + * @type number + * @memberof DefaultApitestEncodePrimitiveNumberPost + */ + body: number +} + +export interface DefaultApiTestEncodePrimitiveStringPostRequest { + /** + * + * @type string + * @memberof DefaultApitestEncodePrimitiveStringPost + */ + body: string +} + +export class ObjectDefaultApi { + private api: ObservableDefaultApi + + public constructor(configuration: Configuration, requestFactory?: DefaultApiRequestFactory, responseProcessor?: DefaultApiResponseProcessor) { + this.api = new ObservableDefaultApi(configuration, requestFactory, responseProcessor); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfArraysGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfArraysGetRequest = {}, options?: ConfigurationOptions): Promise>>> { + return this.api.testDecodeArrayOfArraysGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfArraysGet(param: DefaultApiTestDecodeArrayOfArraysGetRequest = {}, options?: ConfigurationOptions): Promise>> { + return this.api.testDecodeArrayOfArraysGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfGetRequest = {}, options?: ConfigurationOptions): Promise>> { + return this.api.testDecodeArrayOfGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfGet(param: DefaultApiTestDecodeArrayOfGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeArrayOfGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfMapsOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest = {}, options?: ConfigurationOptions): Promise>> { + return this.api.testDecodeArrayOfMapsOfObjectsGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfMapsOfObjectsGet(param: DefaultApiTestDecodeArrayOfMapsOfObjectsGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeArrayOfMapsOfObjectsGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfNullableGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfNullableGetRequest = {}, options?: ConfigurationOptions): Promise>> { + return this.api.testDecodeArrayOfNullableGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfNullableGet(param: DefaultApiTestDecodeArrayOfNullableGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeArrayOfNullableGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfNullableObjectsGetWithHttpInfo(param: DefaultApiTestDecodeArrayOfNullableObjectsGetRequest = {}, options?: ConfigurationOptions): Promise>> { + return this.api.testDecodeArrayOfNullableObjectsGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeArrayOfNullableObjectsGet(param: DefaultApiTestDecodeArrayOfNullableObjectsGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeArrayOfNullableObjectsGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeCompositeObjectsGetWithHttpInfo(param: DefaultApiTestDecodeCompositeObjectsGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeCompositeObjectsGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeCompositeObjectsGet(param: DefaultApiTestDecodeCompositeObjectsGetRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testDecodeCompositeObjectsGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeMapOfMapsOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeMapOfMapsOfObjectsGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeMapOfMapsOfObjectsGet(param: DefaultApiTestDecodeMapOfMapsOfObjectsGetRequest = {}, options?: ConfigurationOptions): Promise<{ [key: string]: { [key: string]: ComplexObject; }; }> { + return this.api.testDecodeMapOfMapsOfObjectsGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeMapOfObjectsGetWithHttpInfo(param: DefaultApiTestDecodeMapOfObjectsGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeMapOfObjectsGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeMapOfObjectsGet(param: DefaultApiTestDecodeMapOfObjectsGetRequest = {}, options?: ConfigurationOptions): Promise<{ [key: string]: ComplexObject | null; }> { + return this.api.testDecodeMapOfObjectsGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeMapOfPrimitiveGetWithHttpInfo(param: DefaultApiTestDecodeMapOfPrimitiveGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeMapOfPrimitiveGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeMapOfPrimitiveGet(param: DefaultApiTestDecodeMapOfPrimitiveGetRequest = {}, options?: ConfigurationOptions): Promise<{ [key: string]: string; }> { + return this.api.testDecodeMapOfPrimitiveGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeNullableArrayGetWithHttpInfo(param: DefaultApiTestDecodeNullableArrayGetRequest = {}, options?: ConfigurationOptions): Promise>> { + return this.api.testDecodeNullableArrayGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeNullableArrayGet(param: DefaultApiTestDecodeNullableArrayGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeNullableArrayGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeNullableGetWithHttpInfo(param: DefaultApiTestDecodeNullableGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeNullableGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeNullableGet(param: DefaultApiTestDecodeNullableGetRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testDecodeNullableGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeObjectGetWithHttpInfo(param: DefaultApiTestDecodeObjectGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodeObjectGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodeObjectGet(param: DefaultApiTestDecodeObjectGetRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testDecodeObjectGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodePrimitiveBooleanGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveBooleanGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodePrimitiveBooleanGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodePrimitiveBooleanGet(param: DefaultApiTestDecodePrimitiveBooleanGetRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testDecodePrimitiveBooleanGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodePrimitiveIntegerGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveIntegerGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodePrimitiveIntegerGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodePrimitiveIntegerGet(param: DefaultApiTestDecodePrimitiveIntegerGetRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testDecodePrimitiveIntegerGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodePrimitiveNumberGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveNumberGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodePrimitiveNumberGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodePrimitiveNumberGet(param: DefaultApiTestDecodePrimitiveNumberGetRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testDecodePrimitiveNumberGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodePrimitiveStringGetWithHttpInfo(param: DefaultApiTestDecodePrimitiveStringGetRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testDecodePrimitiveStringGetWithHttpInfo( options).toPromise(); + } + + /** + * @param param the request object + */ + public testDecodePrimitiveStringGet(param: DefaultApiTestDecodePrimitiveStringGetRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testDecodePrimitiveStringGet( options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfArraysPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfArraysPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeArrayOfArraysPostWithHttpInfo(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfArraysPost(param: DefaultApiTestEncodeArrayOfArraysPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeArrayOfArraysPost(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeArrayOfMapsOfObjectsPostWithHttpInfo(param.complexObject, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfMapsOfObjectsPost(param: DefaultApiTestEncodeArrayOfMapsOfObjectsPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeArrayOfMapsOfObjectsPost(param.complexObject, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfNullableObjectsPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeArrayOfNullableObjectsPostWithHttpInfo(param.complexObject, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfNullableObjectsPost(param: DefaultApiTestEncodeArrayOfNullableObjectsPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeArrayOfNullableObjectsPost(param.complexObject, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfNullablePostWithHttpInfo(param: DefaultApiTestEncodeArrayOfNullablePostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeArrayOfNullablePostWithHttpInfo(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfNullablePost(param: DefaultApiTestEncodeArrayOfNullablePostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeArrayOfNullablePost(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfPostWithHttpInfo(param: DefaultApiTestEncodeArrayOfPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeArrayOfPostWithHttpInfo(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeArrayOfPost(param: DefaultApiTestEncodeArrayOfPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeArrayOfPost(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeCompositeObjectsPostWithHttpInfo(param: DefaultApiTestEncodeCompositeObjectsPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeCompositeObjectsPostWithHttpInfo(param.compositeObject, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeCompositeObjectsPost(param: DefaultApiTestEncodeCompositeObjectsPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeCompositeObjectsPost(param.compositeObject, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeMapOfMapsOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeMapOfMapsOfObjectsPostWithHttpInfo(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeMapOfMapsOfObjectsPost(param: DefaultApiTestEncodeMapOfMapsOfObjectsPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeMapOfMapsOfObjectsPost(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeMapOfObjectsPostWithHttpInfo(param: DefaultApiTestEncodeMapOfObjectsPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeMapOfObjectsPostWithHttpInfo(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeMapOfObjectsPost(param: DefaultApiTestEncodeMapOfObjectsPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeMapOfObjectsPost(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeMapOfPrimitivePostWithHttpInfo(param: DefaultApiTestEncodeMapOfPrimitivePostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeMapOfPrimitivePostWithHttpInfo(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeMapOfPrimitivePost(param: DefaultApiTestEncodeMapOfPrimitivePostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeMapOfPrimitivePost(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeNullableArrayPostWithHttpInfo(param: DefaultApiTestEncodeNullableArrayPostRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeNullableArrayPostWithHttpInfo(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeNullableArrayPost(param: DefaultApiTestEncodeNullableArrayPostRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testEncodeNullableArrayPost(param.requestBody, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeNullablePostWithHttpInfo(param: DefaultApiTestEncodeNullablePostRequest = {}, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeNullablePostWithHttpInfo(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeNullablePost(param: DefaultApiTestEncodeNullablePostRequest = {}, options?: ConfigurationOptions): Promise { + return this.api.testEncodeNullablePost(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeObjectPostWithHttpInfo(param: DefaultApiTestEncodeObjectPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodeObjectPostWithHttpInfo(param.complexObject, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodeObjectPost(param: DefaultApiTestEncodeObjectPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodeObjectPost(param.complexObject, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodePrimitiveBooleanPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveBooleanPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodePrimitiveBooleanPostWithHttpInfo(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodePrimitiveBooleanPost(param: DefaultApiTestEncodePrimitiveBooleanPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodePrimitiveBooleanPost(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodePrimitiveIntegerPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveIntegerPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodePrimitiveIntegerPostWithHttpInfo(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodePrimitiveIntegerPost(param: DefaultApiTestEncodePrimitiveIntegerPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodePrimitiveIntegerPost(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodePrimitiveNumberPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveNumberPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodePrimitiveNumberPostWithHttpInfo(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodePrimitiveNumberPost(param: DefaultApiTestEncodePrimitiveNumberPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodePrimitiveNumberPost(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodePrimitiveStringPostWithHttpInfo(param: DefaultApiTestEncodePrimitiveStringPostRequest, options?: ConfigurationOptions): Promise> { + return this.api.testEncodePrimitiveStringPostWithHttpInfo(param.body, options).toPromise(); + } + + /** + * @param param the request object + */ + public testEncodePrimitiveStringPost(param: DefaultApiTestEncodePrimitiveStringPostRequest, options?: ConfigurationOptions): Promise { + return this.api.testEncodePrimitiveStringPost(param.body, options).toPromise(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts index fdc763ac2e46..fc3b7e90825e 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/models/ParentWithNullable.ts @@ -63,6 +63,7 @@ export function ParentWithNullableFromJSONTyped(json: any, ignoreDiscriminator: if (json['type'] === 'ChildWithNullable') { return ChildWithNullableFromJSONTyped(json, ignoreDiscriminator); } + } return { diff --git a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Animal.ts b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Animal.ts index ae195a01bfa5..6d1cb238fc7a 100644 --- a/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Animal.ts +++ b/samples/client/petstore/typescript-fetch/builds/snakecase-discriminator/models/Animal.ts @@ -58,6 +58,7 @@ export function AnimalFromJSONTyped(json: any, ignoreDiscriminator: boolean): An if (json['class_name'] === 'DOG') { return DogFromJSONTyped(json, ignoreDiscriminator); } + } return { diff --git a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES index 125c3a493a13..e9eaed5106d3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/FILES @@ -1,9 +1,6 @@ .gitattributes .gitignore -PetApi.md README.md -StoreApi.md -UserApi.md apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts @@ -11,6 +8,9 @@ apis/baseapi.ts apis/exception.ts auth/auth.ts configuration.ts +docs/PetApi.md +docs/StoreApi.md +docs/UserApi.md git_push.sh http/http.ts http/isomorphic-fetch.ts diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/explode-query/.openapi-generator/FILES index 8a9627dabd2a..2217ad1ffa2a 100644 --- a/samples/openapi3/client/petstore/typescript/builds/explode-query/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/.openapi-generator/FILES @@ -1,13 +1,6 @@ .gitattributes .gitignore -AnotherFakeApi.md -DefaultApi.md -FakeApi.md -FakeClassnameTags123Api.md -PetApi.md README.md -StoreApi.md -UserApi.md apis/AnotherFakeApi.ts apis/DefaultApi.ts apis/FakeApi.ts @@ -19,6 +12,13 @@ apis/baseapi.ts apis/exception.ts auth/auth.ts configuration.ts +docs/AnotherFakeApi.md +docs/DefaultApi.md +docs/FakeApi.md +docs/FakeClassnameTags123Api.md +docs/PetApi.md +docs/StoreApi.md +docs/UserApi.md git_push.sh http/http.ts http/isomorphic-fetch.ts diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..9ace1cb664de --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/AnotherFakeApi.md @@ -0,0 +1,65 @@ +# petstore.AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**_123testSpecialTags**](AnotherFakeApi.md#_123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + +# **_123testSpecialTags** +> Client _123testSpecialTags(client) + +To test special tags and operation ID starting with number + +### Example + + +```typescript +import { createConfiguration, AnotherFakeApi } from 'ts-petstore-client'; +import type { AnotherFakeApi123testSpecialTagsRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new AnotherFakeApi(configuration); + +const request: AnotherFakeApi123testSpecialTagsRequest = { + // client model + client: { + client: "client_example", + }, +}; + +const data = await apiInstance._123testSpecialTags(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | **Client**| client model | + + +### Return type + +**Client** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/DefaultApi.md b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/DefaultApi.md new file mode 100644 index 000000000000..bdd8ebf8166e --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/DefaultApi.md @@ -0,0 +1,55 @@ +# petstore.DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + +# **fooGet** +> fooGet() + + +### Example + + +```typescript +import { createConfiguration, DefaultApi } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new DefaultApi(configuration); + +const request = {}; + +const data = await apiInstance.fooGet(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | response | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/FakeApi.md b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/FakeApi.md new file mode 100644 index 000000000000..4afa96edc2e9 --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/FakeApi.md @@ -0,0 +1,1139 @@ +# petstore.FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fakeBigDecimalMap**](FakeApi.md#fakeBigDecimalMap) | **GET** /fake/BigDecimalMap | +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakePropertyEnumIntegerSerialize) | **POST** /fake/property/enum-int | +[**testBodyWithBinary**](FakeApi.md#testBodyWithBinary) | **PUT** /fake/body-with-binary | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-parameters | + + +# **fakeBigDecimalMap** +> FakeBigDecimalMap200Response fakeBigDecimalMap() + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request = {}; + +const data = await apiInstance.fakeBigDecimalMap(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +**FakeBigDecimalMap200Response** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **fakeHealthGet** +> HealthCheckResult fakeHealthGet() + + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request = {}; + +const data = await apiInstance.fakeHealthGet(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +**HealthCheckResult** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **fakeHttpSignatureTest** +> void fakeHttpSignatureTest(pet) + + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiFakeHttpSignatureTestRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiFakeHttpSignatureTestRequest = { + // Pet object that needs to be added to the store + pet: { + id: 1, + category: { + id: 1, + name: "default-name", + }, + name: "doggie", + photoUrls: [ + "photoUrls_example", + ], + tags: [ + { + id: 1, + name: "name_example", + }, + ], + status: "available", + }, + // query parameter (optional) + query1: "query_1_example", + // header parameter (optional) + header1: "header_1_example", +}; + +const data = await apiInstance.fakeHttpSignatureTest(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | **Pet**| Pet object that needs to be added to the store | + **query1** | [**string**] | query parameter | (optional) defaults to undefined + **header1** | [**string**] | header parameter | (optional) defaults to undefined + + +### Return type + +**void** + +### Authorization + +[http_signature_test](README.md#http_signature_test) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **fakeOuterBooleanSerialize** +> boolean fakeOuterBooleanSerialize() + +Test serialization of outer boolean types + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiFakeOuterBooleanSerializeRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiFakeOuterBooleanSerializeRequest = { + // Input boolean as post body (optional) + body: true, +}; + +const data = await apiInstance.fakeOuterBooleanSerialize(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **boolean**| Input boolean as post body | + + +### Return type + +**boolean** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output boolean | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **fakeOuterCompositeSerialize** +> OuterComposite fakeOuterCompositeSerialize() + +Test serialization of object with outer number type + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiFakeOuterCompositeSerializeRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiFakeOuterCompositeSerializeRequest = { + // Input composite as post body (optional) + outerComposite: { + myNumber: 3.14, + myString: "myString_example", + myBoolean: true, + }, +}; + +const data = await apiInstance.fakeOuterCompositeSerialize(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | **OuterComposite**| Input composite as post body | + + +### Return type + +**OuterComposite** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output composite | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **fakeOuterNumberSerialize** +> number fakeOuterNumberSerialize() + +Test serialization of outer number types + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiFakeOuterNumberSerializeRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiFakeOuterNumberSerializeRequest = { + // Input number as post body (optional) + body: 3.14, +}; + +const data = await apiInstance.fakeOuterNumberSerialize(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **number**| Input number as post body | + + +### Return type + +**number** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output number | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **fakeOuterStringSerialize** +> string fakeOuterStringSerialize() + +Test serialization of outer string types + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiFakeOuterStringSerializeRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiFakeOuterStringSerializeRequest = { + // Input string as post body (optional) + body: "body_example", +}; + +const data = await apiInstance.fakeOuterStringSerialize(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **string**| Input string as post body | + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output string | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **fakePropertyEnumIntegerSerialize** +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + +Test serialization of enum (int) properties with examples + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiFakePropertyEnumIntegerSerializeRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiFakePropertyEnumIntegerSerializeRequest = { + // Input enum (int) as post body + outerObjectWithEnumProperty: { + value: 2, + }, +}; + +const data = await apiInstance.fakePropertyEnumIntegerSerialize(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerObjectWithEnumProperty** | **OuterObjectWithEnumProperty**| Input enum (int) as post body | + + +### Return type + +**OuterObjectWithEnumProperty** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: */* + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Output enum (int) | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testBodyWithBinary** +> void testBodyWithBinary(body) + +For this test, the body has to be a binary file. + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestBodyWithBinaryRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestBodyWithBinaryRequest = { + // image to upload + body: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, +}; + +const data = await apiInstance.testBodyWithBinary(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **HttpFile**| image to upload | + + +### Return type + +**void** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: image/png + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testBodyWithFileSchema** +> void testBodyWithFileSchema(fileSchemaTestClass) + +For this test, the body for this request must reference a schema named `File`. + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestBodyWithFileSchemaRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestBodyWithFileSchemaRequest = { + + fileSchemaTestClass: { + file: { + sourceURI: "sourceURI_example", + }, + files: [ + { + sourceURI: "sourceURI_example", + }, + ], + }, +}; + +const data = await apiInstance.testBodyWithFileSchema(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fileSchemaTestClass** | **FileSchemaTestClass**| | + + +### Return type + +**void** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testBodyWithQueryParams** +> void testBodyWithQueryParams(user) + + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestBodyWithQueryParamsRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestBodyWithQueryParamsRequest = { + + query: "query_example", + + user: { + id: 1, + username: "username_example", + firstName: "firstName_example", + lastName: "lastName_example", + email: "email_example", + password: "password_example", + phone: "phone_example", + userStatus: 1, + }, +}; + +const data = await apiInstance.testBodyWithQueryParams(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | **User**| | + **query** | [**string**] | | defaults to undefined + + +### Return type + +**void** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testClientModel** +> Client testClientModel(client) + +To test \"client\" model + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestClientModelRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestClientModelRequest = { + // client model + client: { + client: "client_example", + }, +}; + +const data = await apiInstance.testClientModel(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | **Client**| client model | + + +### Return type + +**Client** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEndpointParameters** +> testEndpointParameters() + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestEndpointParametersRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestEndpointParametersRequest = { + // None + number: 32.1, + // None + _double: 67.8, + // None + patternWithoutDelimiter: "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>", + // None + _byte: 'YQ==', + // None (optional) + integer: 10, + // None (optional) + int32: 20, + // None (optional) + int64: 1, + // None (optional) + _float: 3.14, + // None (optional) + string: "/a/i", + // None (optional) + binary: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, + // None (optional) + date: new Date('1970-01-01').toISOString().split('T')[0];, + // None (optional) + dateTime: new Date('1970-01-01T00:00:00.00Z'), + // None (optional) + password: "password_example", + // None (optional) + callback: "callback_example", +}; + +const data = await apiInstance.testEndpointParameters(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | [**number**] | None | defaults to undefined + **_double** | [**number**] | None | defaults to undefined + **patternWithoutDelimiter** | [**string**] | None | defaults to undefined + **_byte** | [**string**] | None | defaults to undefined + **integer** | [**number**] | None | (optional) defaults to undefined + **int32** | [**number**] | None | (optional) defaults to undefined + **int64** | [**number**] | None | (optional) defaults to undefined + **_float** | [**number**] | None | (optional) defaults to undefined + **string** | [**string**] | None | (optional) defaults to undefined + **binary** | [**HttpFile**] | None | (optional) defaults to undefined + **date** | [**string**] | None | (optional) defaults to undefined + **dateTime** | [**Date**] | None | (optional) defaults to undefined + **password** | [**string**] | None | (optional) defaults to undefined + **callback** | [**string**] | None | (optional) defaults to undefined + + +### Return type + +void (empty response body) + +### Authorization + +[http_basic_test](README.md#http_basic_test) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testEnumParameters** +> testEnumParameters() + +To test enum parameters + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestEnumParametersRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestEnumParametersRequest = { + // Header parameter enum test (string array) (optional) + enumHeaderStringArray: [ + "$", + ], + // Header parameter enum test (string) (optional) + enumHeaderString: "-efg", + // Query parameter enum test (string array) (optional) + enumQueryStringArray: [ + "$", + ], + // Query parameter enum test (string) (optional) + enumQueryString: "-efg", + // Query parameter enum test (double) (optional) + enumQueryInteger: 1, + // Query parameter enum test (double) (optional) + enumQueryDouble: 1.1, + + enumQueryModelArray: [ + "-efg", + ], + // Form parameter enum test (string array) (optional) + enumFormStringArray: [ + "$", + ], + // Form parameter enum test (string) (optional) + enumFormString: "-efg", +}; + +const data = await apiInstance.testEnumParameters(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | **Array<'>' | '$'>** | Header parameter enum test (string array) | (optional) defaults to undefined + **enumHeaderString** | [**'_abc' | '-efg' | '(xyz)'**]**Array<'_abc' | '-efg' | '(xyz)'>** | Header parameter enum test (string) | (optional) defaults to '-efg' + **enumQueryStringArray** | **Array<'>' | '$'>** | Query parameter enum test (string array) | (optional) defaults to undefined + **enumQueryString** | [**'_abc' | '-efg' | '(xyz)'**]**Array<'_abc' | '-efg' | '(xyz)'>** | Query parameter enum test (string) | (optional) defaults to '-efg' + **enumQueryInteger** | [**1 | -2**]**Array<1 | -2>** | Query parameter enum test (double) | (optional) defaults to undefined + **enumQueryDouble** | [**1.1 | -1.2**]**Array<1.1 | -1.2>** | Query parameter enum test (double) | (optional) defaults to undefined + **enumQueryModelArray** | **Array<EnumClass>** | | (optional) defaults to undefined + **enumFormStringArray** | **Array<'>' | '$'>** | Form parameter enum test (string array) | (optional) defaults to '$' + **enumFormString** | [**string**]**Array<'_abc' | '-efg' | '(xyz)'>** | Form parameter enum test (string) | (optional) defaults to '-efg' + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid request | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testGroupParameters** +> testGroupParameters() + +Fake endpoint to test group parameters (optional) + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestGroupParametersRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestGroupParametersRequest = { + // Required String in group parameters + requiredStringGroup: 1, + // Required Boolean in group parameters + requiredBooleanGroup: true, + // Required Integer in group parameters + requiredInt64Group: 1, + // String in group parameters (optional) + stringGroup: 1, + // Boolean in group parameters (optional) + booleanGroup: true, + // Integer in group parameters (optional) + int64Group: 1, +}; + +const data = await apiInstance.testGroupParameters(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | [**number**] | Required String in group parameters | defaults to undefined + **requiredBooleanGroup** | [**boolean**] | Required Boolean in group parameters | defaults to undefined + **requiredInt64Group** | [**number**] | Required Integer in group parameters | defaults to undefined + **stringGroup** | [**number**] | String in group parameters | (optional) defaults to undefined + **booleanGroup** | [**boolean**] | Boolean in group parameters | (optional) defaults to undefined + **int64Group** | [**number**] | Integer in group parameters | (optional) defaults to undefined + + +### Return type + +void (empty response body) + +### Authorization + +[bearer_test](README.md#bearer_test) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Something wrong | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testInlineAdditionalProperties** +> void testInlineAdditionalProperties(requestBody) + + + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestInlineAdditionalPropertiesRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestInlineAdditionalPropertiesRequest = { + // request body + requestBody: { + "key": "key_example", + }, +}; + +const data = await apiInstance.testInlineAdditionalProperties(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requestBody** | **{ [key: string]: string; }**| request body | + + +### Return type + +**void** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testJsonFormData** +> void testJsonFormData() + + + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestJsonFormDataRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestJsonFormDataRequest = { + // field1 + param: "param_example", + // field2 + param2: "param2_example", +}; + +const data = await apiInstance.testJsonFormData(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | [**string**] | field1 | defaults to undefined + **param2** | [**string**] | field2 | defaults to undefined + + +### Return type + +**void** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **testQueryParameterCollectionFormat** +> void testQueryParameterCollectionFormat() + +To test the collection format in query parameters + +### Example + + +```typescript +import { createConfiguration, FakeApi } from 'ts-petstore-client'; +import type { FakeApiTestQueryParameterCollectionFormatRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeApi(configuration); + +const request: FakeApiTestQueryParameterCollectionFormatRequest = { + + pipe: [ + "pipe_example", + ], + + ioutil: [ + "ioutil_example", + ], + + http: [ + "http_example", + ], + + url: [ + "url_example", + ], + + context: [ + "context_example", + ], + + allowEmpty: "allowEmpty_example", + + language: { + "key": "key_example", + }, +}; + +const data = await apiInstance.testQueryParameterCollectionFormat(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | **Array<string>** | | defaults to undefined + **ioutil** | **Array<string>** | | defaults to undefined + **http** | **Array<string>** | | defaults to undefined + **url** | **Array<string>** | | defaults to undefined + **context** | **Array<string>** | | defaults to undefined + **allowEmpty** | [**string**] | | defaults to undefined + **language** | **{ [key: string]: string; }** | | (optional) defaults to undefined + + +### Return type + +**void** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..bcc8b962966d --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/FakeClassnameTags123Api.md @@ -0,0 +1,65 @@ +# petstore.FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + +# **testClassname** +> Client testClassname(client) + +To test class name in snake case + +### Example + + +```typescript +import { createConfiguration, FakeClassnameTags123Api } from 'ts-petstore-client'; +import type { FakeClassnameTags123ApiTestClassnameRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new FakeClassnameTags123Api(configuration); + +const request: FakeClassnameTags123ApiTestClassnameRequest = { + // client model + client: { + client: "client_example", + }, +}; + +const data = await apiInstance.testClassname(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **client** | **Client**| client model | + + +### Return type + +**Client** + +### Authorization + +[api_key_query](README.md#api_key_query) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/PetApi.md b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/PetApi.md new file mode 100644 index 000000000000..c83cc6be7ea4 --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/PetApi.md @@ -0,0 +1,564 @@ +# petstore.PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + +# **addPet** +> void addPet(pet) + + + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiAddPetRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiAddPetRequest = { + // Pet object that needs to be added to the store + pet: { + id: 1, + category: { + id: 1, + name: "default-name", + }, + name: "doggie", + photoUrls: [ + "photoUrls_example", + ], + tags: [ + { + id: 1, + name: "name_example", + }, + ], + status: "available", + }, +}; + +const data = await apiInstance.addPet(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | **Pet**| Pet object that needs to be added to the store | + + +### Return type + +**void** + +### Authorization + +[petstore_auth](README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **deletePet** +> void deletePet() + + + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiDeletePetRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiDeletePetRequest = { + // Pet id to delete + petId: 1, + + apiKey: "api_key_example", +}; + +const data = await apiInstance.deletePet(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | [**number**] | Pet id to delete | defaults to undefined + **apiKey** | [**string**] | | (optional) defaults to undefined + + +### Return type + +**void** + +### Authorization + +[petstore_auth](README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid pet value | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **findPetsByStatus** +> Array findPetsByStatus() + +Multiple status values can be provided with comma separated strings + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiFindPetsByStatusRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiFindPetsByStatusRequest = { + // Status values that need to be considered for filter + status: [ + "available", + ], +}; + +const data = await apiInstance.findPetsByStatus(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | **Array<'available' | 'pending' | 'sold'>** | Status values that need to be considered for filter | defaults to undefined + + +### Return type + +**Array** + +### Authorization + +[petstore_auth](README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid status value | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **findPetsByTags** +> Set findPetsByTags() + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiFindPetsByTagsRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiFindPetsByTagsRequest = { + // Tags to filter by + tags: [ + "tags_example", + ], +}; + +const data = await apiInstance.findPetsByTags(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | **Set<string>** | Tags to filter by | defaults to undefined + + +### Return type + +**Set** + +### Authorization + +[petstore_auth](README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid tag value | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **getPetById** +> Pet getPetById() + +Returns a single pet + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiGetPetByIdRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiGetPetByIdRequest = { + // ID of pet to return + petId: 1, +}; + +const data = await apiInstance.getPetById(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | [**number**] | ID of pet to return | defaults to undefined + + +### Return type + +**Pet** + +### Authorization + +[api_key](README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **updatePet** +> void updatePet(pet) + + + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiUpdatePetRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiUpdatePetRequest = { + // Pet object that needs to be added to the store + pet: { + id: 1, + category: { + id: 1, + name: "default-name", + }, + name: "doggie", + photoUrls: [ + "photoUrls_example", + ], + tags: [ + { + id: 1, + name: "name_example", + }, + ], + status: "available", + }, +}; + +const data = await apiInstance.updatePet(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | **Pet**| Pet object that needs to be added to the store | + + +### Return type + +**void** + +### Authorization + +[petstore_auth](README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Pet not found | - | +**405** | Validation exception | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **updatePetWithForm** +> void updatePetWithForm() + + + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiUpdatePetWithFormRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiUpdatePetWithFormRequest = { + // ID of pet that needs to be updated + petId: 1, + // Updated name of the pet (optional) + name: "name_example", + // Updated status of the pet (optional) + status: "status_example", +}; + +const data = await apiInstance.updatePetWithForm(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | [**number**] | ID of pet that needs to be updated | defaults to undefined + **name** | [**string**] | Updated name of the pet | (optional) defaults to undefined + **status** | [**string**] | Updated status of the pet | (optional) defaults to undefined + + +### Return type + +**void** + +### Authorization + +[petstore_auth](README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful operation | - | +**405** | Invalid input | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **uploadFile** +> ApiResponse uploadFile() + + + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiUploadFileRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiUploadFileRequest = { + // ID of pet to update + petId: 1, + // Additional data to pass to server (optional) + additionalMetadata: "additionalMetadata_example", + // file to upload (optional) + file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, +}; + +const data = await apiInstance.uploadFile(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | [**number**] | ID of pet to update | defaults to undefined + **additionalMetadata** | [**string**] | Additional data to pass to server | (optional) defaults to undefined + **file** | [**HttpFile**] | file to upload | (optional) defaults to undefined + + +### Return type + +**ApiResponse** + +### Authorization + +[petstore_auth](README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **uploadFileWithRequiredFile** +> ApiResponse uploadFileWithRequiredFile() + + + +### Example + + +```typescript +import { createConfiguration, PetApi } from 'ts-petstore-client'; +import type { PetApiUploadFileWithRequiredFileRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new PetApi(configuration); + +const request: PetApiUploadFileWithRequiredFileRequest = { + // ID of pet to update + petId: 1, + // file to upload + requiredFile: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' }, + // Additional data to pass to server (optional) + additionalMetadata: "additionalMetadata_example", +}; + +const data = await apiInstance.uploadFileWithRequiredFile(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | [**number**] | ID of pet to update | defaults to undefined + **requiredFile** | [**HttpFile**] | file to upload | defaults to undefined + **additionalMetadata** | [**string**] | Additional data to pass to server | (optional) defaults to undefined + + +### Return type + +**ApiResponse** + +### Authorization + +[petstore_auth](README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/StoreApi.md b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/StoreApi.md new file mode 100644 index 000000000000..f3588b9e4cc3 --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/StoreApi.md @@ -0,0 +1,229 @@ +# petstore.StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +> deleteOrder() + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + + +```typescript +import { createConfiguration, StoreApi } from 'ts-petstore-client'; +import type { StoreApiDeleteOrderRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new StoreApi(configuration); + +const request: StoreApiDeleteOrderRequest = { + // ID of the order that needs to be deleted + orderId: "order_id_example", +}; + +const data = await apiInstance.deleteOrder(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | [**string**] | ID of the order that needs to be deleted | defaults to undefined + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **getInventory** +> { [key: string]: number; } getInventory() + +Returns a map of status codes to quantities + +### Example + + +```typescript +import { createConfiguration, StoreApi } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new StoreApi(configuration); + +const request = {}; + +const data = await apiInstance.getInventory(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +**{ [key: string]: number; }** + +### Authorization + +[api_key](README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **getOrderById** +> Order getOrderById() + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + + +```typescript +import { createConfiguration, StoreApi } from 'ts-petstore-client'; +import type { StoreApiGetOrderByIdRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new StoreApi(configuration); + +const request: StoreApiGetOrderByIdRequest = { + // ID of pet that needs to be fetched + orderId: 1, +}; + +const data = await apiInstance.getOrderById(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | [**number**] | ID of pet that needs to be fetched | defaults to undefined + + +### Return type + +**Order** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid ID supplied | - | +**404** | Order not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **placeOrder** +> Order placeOrder(order) + + + +### Example + + +```typescript +import { createConfiguration, StoreApi } from 'ts-petstore-client'; +import type { StoreApiPlaceOrderRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new StoreApi(configuration); + +const request: StoreApiPlaceOrderRequest = { + // order placed for purchasing the pet + order: { + id: 1, + petId: 1, + quantity: 1, + shipDate: new Date('1970-01-01T00:00:00.00Z'), + status: "placed", + complete: false, + }, +}; + +const data = await apiInstance.placeOrder(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | **Order**| order placed for purchasing the pet | + + +### Return type + +**Order** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid Order | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/UserApi.md b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/UserApi.md new file mode 100644 index 000000000000..c5965ee51881 --- /dev/null +++ b/samples/openapi3/client/petstore/typescript/builds/explode-query/docs/UserApi.md @@ -0,0 +1,485 @@ +# petstore.UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +# **createUser** +> createUser(user) + +This can only be done by the logged in user. + +### Example + + +```typescript +import { createConfiguration, UserApi } from 'ts-petstore-client'; +import type { UserApiCreateUserRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new UserApi(configuration); + +const request: UserApiCreateUserRequest = { + // Created user object + user: { + id: 1, + username: "username_example", + firstName: "firstName_example", + lastName: "lastName_example", + email: "email_example", + password: "password_example", + phone: "phone_example", + userStatus: 1, + }, +}; + +const data = await apiInstance.createUser(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | **User**| Created user object | + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **createUsersWithArrayInput** +> createUsersWithArrayInput(user) + + + +### Example + + +```typescript +import { createConfiguration, UserApi } from 'ts-petstore-client'; +import type { UserApiCreateUsersWithArrayInputRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new UserApi(configuration); + +const request: UserApiCreateUsersWithArrayInputRequest = { + // List of user object + user: [ + { + id: 1, + username: "username_example", + firstName: "firstName_example", + lastName: "lastName_example", + email: "email_example", + password: "password_example", + phone: "phone_example", + userStatus: 1, + }, + ], +}; + +const data = await apiInstance.createUsersWithArrayInput(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | **Array**| List of user object | + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **createUsersWithListInput** +> createUsersWithListInput(user) + + + +### Example + + +```typescript +import { createConfiguration, UserApi } from 'ts-petstore-client'; +import type { UserApiCreateUsersWithListInputRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new UserApi(configuration); + +const request: UserApiCreateUsersWithListInputRequest = { + // List of user object + user: [ + { + id: 1, + username: "username_example", + firstName: "firstName_example", + lastName: "lastName_example", + email: "email_example", + password: "password_example", + phone: "phone_example", + userStatus: 1, + }, + ], +}; + +const data = await apiInstance.createUsersWithListInput(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | **Array**| List of user object | + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **deleteUser** +> deleteUser() + +This can only be done by the logged in user. + +### Example + + +```typescript +import { createConfiguration, UserApi } from 'ts-petstore-client'; +import type { UserApiDeleteUserRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new UserApi(configuration); + +const request: UserApiDeleteUserRequest = { + // The name that needs to be deleted + username: "username_example", +}; + +const data = await apiInstance.deleteUser(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | [**string**] | The name that needs to be deleted | defaults to undefined + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **getUserByName** +> User getUserByName() + + + +### Example + + +```typescript +import { createConfiguration, UserApi } from 'ts-petstore-client'; +import type { UserApiGetUserByNameRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new UserApi(configuration); + +const request: UserApiGetUserByNameRequest = { + // The name that needs to be fetched. Use user1 for testing. + username: "username_example", +}; + +const data = await apiInstance.getUserByName(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | [**string**] | The name that needs to be fetched. Use user1 for testing. | defaults to undefined + + +### Return type + +**User** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | - | +**400** | Invalid username supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **loginUser** +> string loginUser() + + + +### Example + + +```typescript +import { createConfiguration, UserApi } from 'ts-petstore-client'; +import type { UserApiLoginUserRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new UserApi(configuration); + +const request: UserApiLoginUserRequest = { + // The user name for login + username: "username_example", + // The password for login in clear text + password: "password_example", +}; + +const data = await apiInstance.loginUser(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | [**string**] | The user name for login | defaults to undefined + **password** | [**string**] | The password for login in clear text | defaults to undefined + + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
* X-Expires-After - date in UTC when token expires
| +**400** | Invalid username/password supplied | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **logoutUser** +> logoutUser() + + + +### Example + + +```typescript +import { createConfiguration, UserApi } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new UserApi(configuration); + +const request = {}; + +const data = await apiInstance.logoutUser(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters +This endpoint does not need any parameter. + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**0** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + +# **updateUser** +> updateUser(user) + +This can only be done by the logged in user. + +### Example + + +```typescript +import { createConfiguration, UserApi } from 'ts-petstore-client'; +import type { UserApiUpdateUserRequest } from 'ts-petstore-client'; + +const configuration = createConfiguration(); +const apiInstance = new UserApi(configuration); + +const request: UserApiUpdateUserRequest = { + // name that need to be deleted + username: "username_example", + // Updated user object + user: { + id: 1, + username: "username_example", + firstName: "firstName_example", + lastName: "lastName_example", + email: "email_example", + password: "password_example", + phone: "phone_example", + userStatus: 1, + }, +}; + +const data = await apiInstance.updateUser(request); +console.log('API called successfully. Returned data:', data); +``` + + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | **User**| Updated user object | + **username** | [**string**] | name that need to be deleted | defaults to undefined + + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**400** | Invalid user supplied | - | +**404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md) + + diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/FILES index 6ea98493524d..62b5825b1439 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/FILES @@ -1,9 +1,6 @@ .gitattributes .gitignore -PetApi.md README.md -StoreApi.md -UserApi.md apis/PetApi.service.ts apis/PetApi.ts apis/StoreApi.service.ts @@ -14,6 +11,9 @@ apis/baseapi.ts apis/exception.ts auth/auth.ts configuration.ts +docs/PetApi.md +docs/StoreApi.md +docs/UserApi.md git_push.sh http/http.ts http/isomorphic-fetch.ts diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/tsconfig.json b/samples/openapi3/client/petstore/typescript/builds/inversify/tsconfig.json index e69de29bb2d1..047850335fa7 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/tsconfig.json +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "node", + "declaration": true, + "typeRoots": [ + "node_modules/@types" + ], + + /* Additional Checks */ + "noUnusedLocals": false, /* Report errors on unused locals. */ // TODO: reenable (unused imports!) + "noUnusedParameters": false, /* Report errors on unused parameters. */ // TODO: set to true again + "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + + "removeComments": true, + "sourceMap": true, + "outDir": "./dist", + "noLib": false, + "lib": [ + "es6" + ,"ES2017.Object" + ,"ES2021.String" + ], + "experimentalDecorators": true, + }, + "exclude": [ + "dist", + "node_modules" + ], + "filesGlob": [ + "./**/*.ts", + ] +} diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/FILES index 40e160f71b6e..7c89fd84638a 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/FILES @@ -1,9 +1,6 @@ .gitattributes .gitignore -PetApi.md README.md -StoreApi.md -UserApi.md apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts @@ -11,6 +8,9 @@ apis/baseapi.ts apis/exception.ts auth/auth.ts configuration.ts +docs/PetApi.md +docs/StoreApi.md +docs/UserApi.md git_push.sh http/http.ts http/jquery.ts diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/FILES b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/FILES index 125c3a493a13..e9eaed5106d3 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/FILES @@ -1,9 +1,6 @@ .gitattributes .gitignore -PetApi.md README.md -StoreApi.md -UserApi.md apis/PetApi.ts apis/StoreApi.ts apis/UserApi.ts @@ -11,6 +8,9 @@ apis/baseapi.ts apis/exception.ts auth/auth.ts configuration.ts +docs/PetApi.md +docs/StoreApi.md +docs/UserApi.md git_push.sh http/http.ts http/isomorphic-fetch.ts diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/rxjsStub.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/rxjsStub.ts index e69de29bb2d1..4c73715a2486 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/rxjsStub.ts +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/rxjsStub.ts @@ -0,0 +1,27 @@ +export class Observable { + constructor(private promise: Promise) {} + + toPromise() { + return this.promise; + } + + pipe(callback: (value: T) => S | Promise): Observable { + return new Observable(this.promise.then(callback)); + } +} + +export function from(promise: Promise) { + return new Observable(promise); +} + +export function of(value: T) { + return new Observable(Promise.resolve(value)); +} + +export function mergeMap(callback: (value: T) => Observable) { + return (value: T) => callback(value).toPromise(); +} + +export function map(callback: any) { + return callback; +} diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index e69de29bb2d1..c84f9d0e1089 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,300 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.17.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.time.OffsetDateTime; +import org.openapitools.model.User; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.17.0-SNAPSHOT") +@Validated +@Api(value = "user", description = "Operations about user") +public interface UserApi { + + default Optional getRequest() { + return Optional.empty(); + } + + public static final String PATH_CREATE_USER = "/user"; + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = UserApi.PATH_CREATE_USER + ) + + default ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + public static final String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT + ) + + default ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + public static final String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT + ) + + default ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid User> body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + public static final String PATH_DELETE_USER = "/user/{username}"; + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = UserApi.PATH_DELETE_USER + ) + + default ResponseEntity deleteUser( + @NotNull @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + public static final String PATH_GET_USER_BY_NAME = "/user/{username}"; + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + response = User.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = User.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = UserApi.PATH_GET_USER_BY_NAME, + produces = { "application/xml", "application/json" } + ) + + default ResponseEntity getUserByName( + @NotNull @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + public static final String PATH_LOGIN_USER = "/user/login"; + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + @ApiOperation( + tags = { "user" }, + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = String.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") + }) + @RequestMapping( + method = RequestMethod.GET, + value = UserApi.PATH_LOGIN_USER, + produces = { "application/xml", "application/json" } + ) + + default ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + public static final String PATH_LOGOUT_USER = "/user/logout"; + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.GET, + value = UserApi.PATH_LOGOUT_USER + ) + + default ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + public static final String PATH_UPDATE_USER = "/user/{username}"; + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = UserApi.PATH_UPDATE_USER + ) + + default ResponseEntity updateUser( + @NotNull @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +}