diff --git a/bin/configs/typescript-fetch-kebab-case.yaml b/bin/configs/typescript-fetch-kebab-case.yaml new file mode 100644 index 000000000000..cb1922693ec4 --- /dev/null +++ b/bin/configs/typescript-fetch-kebab-case.yaml @@ -0,0 +1,6 @@ +generatorName: typescript-fetch +outputDir: samples/client/petstore/typescript-fetch/builds/kebab-case +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-fetch +additionalProperties: + fileNaming: kebab-case 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 ce27455eabd3..ebba4800f4e2 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 @@ -957,6 +957,7 @@ private void addOperationModelImportInformation(OperationsMap operations) { existingClassNames.add(className); existingRecordClassNames.add(className + "Record"); im.put("className", className); + im.put("classFileName", convertUsingFileNamingConvention(className)); } if (this.getSagasAndRecords()) { diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 82f466757b86..019b3f3e7c0c 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -16,7 +16,7 @@ import { type {{className}}, {{className}}FromJSON, {{className}}ToJSON, -} from '../models/{{className}}{{importFileExtension}}'; +} from '../models/{{classFileName}}{{importFileExtension}}'; {{/imports}} {{/withoutRuntimeChecks}} diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/sagas.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/sagas.mustache index 1d63188c74c8..d6d8551636c2 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/sagas.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/sagas.mustache @@ -11,11 +11,11 @@ import { Action } from "redux-ts-simple"; {{#imports}} import { {{className}}, -} from '../models/{{className}}{{importFileExtension}}'; +} from '../models/{{classFileName}}{{importFileExtension}}'; import { {{className}}Record, {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}RecordUtils, -} from '../models/{{className}}Record{{importFileExtension}}'; +} from '../models/{{classFileName}}Record{{importFileExtension}}'; {{/imports}} {{#passthroughImports}} import { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java index 094929f2fe53..c21cce633eae 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientCodegenTest.java @@ -294,6 +294,7 @@ public void testGeneratedFilenamesInKebabCase() throws IOException { Map properties = new HashMap<>(); properties.put("fileNaming", TypeScriptFetchClientCodegen.KEBAB_CASE); + properties.put(TypeScriptFetchClientCodegen.WITHOUT_RUNTIME_CHECKS, false); File output = generate(properties); @@ -301,7 +302,10 @@ public void testGeneratedFilenamesInKebabCase() throws IOException { TestUtils.assertFileExists(pet); TestUtils.assertFileContains(pet, "} from './pet-category';"); TestUtils.assertFileExists(Paths.get(output + "/models/pet-category.ts")); - TestUtils.assertFileExists(Paths.get(output + "/apis/pet-controller-api.ts")); + Path petApi = Paths.get(output + "/apis/pet-controller-api.ts"); + TestUtils.assertFileExists(petApi); + TestUtils.assertFileContains(petApi, "} from '../models/pet';"); + TestUtils.assertFileNotContains(petApi, "} from '../models/Pet';"); } @Test(description = "Verify names of files generated in kebab-case and imports with additional model prefix") @@ -310,6 +314,7 @@ public void testGeneratedFilenamesInKebabCaseWithAdditionalModelPrefix() throws Map properties = new HashMap<>(); properties.put("fileNaming", TypeScriptFetchClientCodegen.KEBAB_CASE); properties.put(CodegenConstants.MODEL_NAME_PREFIX, "SomePrefix"); + properties.put(TypeScriptFetchClientCodegen.WITHOUT_RUNTIME_CHECKS, false); File output = generate(properties); @@ -317,7 +322,10 @@ public void testGeneratedFilenamesInKebabCaseWithAdditionalModelPrefix() throws TestUtils.assertFileExists(pet); TestUtils.assertFileContains(pet, "} from './some-prefix-pet-category';"); TestUtils.assertFileExists(Paths.get(output + "/models/some-prefix-pet-category.ts")); - TestUtils.assertFileExists(Paths.get(output + "/apis/pet-controller-api.ts")); + Path petApi = Paths.get(output + "/apis/pet-controller-api.ts"); + TestUtils.assertFileExists(petApi); + TestUtils.assertFileContains(petApi, "} from '../models/some-prefix-pet';"); + TestUtils.assertFileNotContains(petApi, "} from '../models/SomePrefixPet';"); } @Test(description = "Verify names of files generated in camelCase and imports") diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/.openapi-generator-ignore b/samples/client/petstore/typescript-fetch/builds/kebab-case/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/.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/petstore/typescript-fetch/builds/kebab-case/.openapi-generator/FILES b/samples/client/petstore/typescript-fetch/builds/kebab-case/.openapi-generator/FILES new file mode 100644 index 000000000000..a8b4a4899956 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/.openapi-generator/FILES @@ -0,0 +1,118 @@ +apis/another-fake-api.ts +apis/default-api.ts +apis/fake-api.ts +apis/fake-classname-tags123-api.ts +apis/index.ts +apis/pet-api.ts +apis/store-api.ts +apis/user-api.ts +docs/AdditionalPropertiesClass.md +docs/AllOfWithSingleRef.md +docs/Animal.md +docs/AnotherFakeApi.md +docs/ArrayOfArrayOfNumberOnly.md +docs/ArrayOfNumberOnly.md +docs/ArrayTest.md +docs/Capitalization.md +docs/Cat.md +docs/Category.md +docs/ChildWithNullable.md +docs/ClassModel.md +docs/Client.md +docs/DefaultApi.md +docs/DeprecatedObject.md +docs/Dog.md +docs/EnumArrays.md +docs/EnumClass.md +docs/EnumTest.md +docs/FakeApi.md +docs/FakeBigDecimalMap200Response.md +docs/FakeClassnameTags123Api.md +docs/FileSchemaTestClass.md +docs/Foo.md +docs/FooGetDefaultResponse.md +docs/FormatTest.md +docs/HasOnlyReadOnly.md +docs/HealthCheckResult.md +docs/List.md +docs/MapTest.md +docs/MixedPropertiesAndAdditionalPropertiesClass.md +docs/Model200Response.md +docs/ModelApiResponse.md +docs/ModelFile.md +docs/Name.md +docs/NullableClass.md +docs/NumberOnly.md +docs/ObjectWithDeprecatedFields.md +docs/Order.md +docs/OuterComposite.md +docs/OuterEnum.md +docs/OuterEnumDefaultValue.md +docs/OuterEnumInteger.md +docs/OuterEnumIntegerDefaultValue.md +docs/OuterObjectWithEnumProperty.md +docs/ParentWithNullable.md +docs/Pet.md +docs/PetApi.md +docs/ReadOnlyFirst.md +docs/Return.md +docs/SingleRefType.md +docs/SpecialModelName.md +docs/StoreApi.md +docs/Tag.md +docs/TestInlineFreeformAdditionalPropertiesRequest.md +docs/User.md +docs/UserApi.md +index.ts +models/additional-properties-class.ts +models/all-of-with-single-ref.ts +models/animal.ts +models/array-of-array-of-number-only.ts +models/array-of-number-only.ts +models/array-test.ts +models/capitalization.ts +models/cat.ts +models/category.ts +models/child-with-nullable.ts +models/class-model.ts +models/client.ts +models/deprecated-object.ts +models/dog.ts +models/enum-arrays.ts +models/enum-class.ts +models/enum-test.ts +models/fake-big-decimal-map200-response.ts +models/file-schema-test-class.ts +models/foo-get-default-response.ts +models/foo.ts +models/format-test.ts +models/has-only-read-only.ts +models/health-check-result.ts +models/index.ts +models/list.ts +models/map-test.ts +models/mixed-properties-and-additional-properties-class.ts +models/model-api-response.ts +models/model-file.ts +models/model200-response.ts +models/name.ts +models/nullable-class.ts +models/number-only.ts +models/object-with-deprecated-fields.ts +models/order.ts +models/outer-composite.ts +models/outer-enum-default-value.ts +models/outer-enum-integer-default-value.ts +models/outer-enum-integer.ts +models/outer-enum.ts +models/outer-object-with-enum-property.ts +models/parent-with-nullable.ts +models/pet.ts +models/read-only-first.ts +models/return.ts +models/single-ref-type.ts +models/special-model-name.ts +models/tag.ts +models/test-inline-freeform-additional-properties-request.ts +models/user.ts +runtime.ts diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/kebab-case/.openapi-generator/VERSION new file mode 100644 index 000000000000..186c33c96ed8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.24.0-SNAPSHOT diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/another-fake-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/another-fake-api.ts new file mode 100644 index 000000000000..43528ff7c7da --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/another-fake-api.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 Client, + ClientFromJSON, + ClientToJSON, +} from '../models/client'; + +export interface 123testSpecialTagsRequest { + client: Client; +} + +/** + * + */ +export class AnotherFakeApi extends runtime.BaseAPI { + + /** + * Creates request options for _123testSpecialTags without sending the request + */ + async _123testSpecialTagsRequestOpts(requestParameters: 123testSpecialTagsRequest): Promise { + if (requestParameters['client'] == null) { + throw new runtime.RequiredError( + 'client', + 'Required parameter "client" was null or undefined when calling _123testSpecialTags().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/another-fake/dummy`; + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: ClientToJSON(requestParameters['client']), + }; + } + + /** + * To test special tags and operation ID starting with number + * To test special tags + */ + async _123testSpecialTagsRaw(requestParameters: 123testSpecialTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this._123testSpecialTagsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ClientFromJSON(jsonValue)); + } + + /** + * To test special tags and operation ID starting with number + * To test special tags + */ + async _123testSpecialTags(requestParameters: 123testSpecialTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this._123testSpecialTagsRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/default-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/default-api.ts new file mode 100644 index 000000000000..ba32526c8fa3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/default-api.ts @@ -0,0 +1,62 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 FooGetDefaultResponse, + FooGetDefaultResponseFromJSON, + FooGetDefaultResponseToJSON, +} from '../models/foo-get-default-response'; + +/** + * + */ +export class DefaultApi extends runtime.BaseAPI { + + /** + * Creates request options for fooGet without sending the request + */ + async fooGetRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/foo`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + */ + async fooGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fooGetRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FooGetDefaultResponseFromJSON(jsonValue)); + } + + /** + */ + async fooGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fooGetRaw(initOverrides); + return await response.value(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-api.ts new file mode 100644 index 000000000000..1eebd5bd8f8a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-api.ts @@ -0,0 +1,1549 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 ChildWithNullable, + ChildWithNullableFromJSON, + ChildWithNullableToJSON, +} from '../models/child-with-nullable'; +import { + type Client, + ClientFromJSON, + ClientToJSON, +} from '../models/client'; +import { + type EnumClass, + EnumClassFromJSON, + EnumClassToJSON, +} from '../models/enum-class'; +import { + type FakeBigDecimalMap200Response, + FakeBigDecimalMap200ResponseFromJSON, + FakeBigDecimalMap200ResponseToJSON, +} from '../models/fake-big-decimal-map200-response'; +import { + type FileSchemaTestClass, + FileSchemaTestClassFromJSON, + FileSchemaTestClassToJSON, +} from '../models/file-schema-test-class'; +import { + type HealthCheckResult, + HealthCheckResultFromJSON, + HealthCheckResultToJSON, +} from '../models/health-check-result'; +import { + type OuterComposite, + OuterCompositeFromJSON, + OuterCompositeToJSON, +} from '../models/outer-composite'; +import { + type OuterObjectWithEnumProperty, + OuterObjectWithEnumPropertyFromJSON, + OuterObjectWithEnumPropertyToJSON, +} from '../models/outer-object-with-enum-property'; +import { + type Pet, + PetFromJSON, + PetToJSON, +} from '../models/pet'; +import { + type TestInlineFreeformAdditionalPropertiesRequest, + TestInlineFreeformAdditionalPropertiesRequestFromJSON, + TestInlineFreeformAdditionalPropertiesRequestToJSON, +} from '../models/test-inline-freeform-additional-properties-request'; +import { + type User, + UserFromJSON, + UserToJSON, +} from '../models/user'; + +export interface FakeHttpSignatureTestRequest { + pet: Pet; + query1?: string; + header1?: string; +} + +export interface FakeOuterBooleanSerializeRequest { + body?: boolean; +} + +export interface FakeOuterCompositeSerializeRequest { + outerComposite?: OuterComposite; +} + +export interface FakeOuterNumberSerializeRequest { + body?: number; +} + +export interface FakeOuterStringSerializeRequest { + body?: string; +} + +export interface FakePropertyEnumIntegerSerializeRequest { + outerObjectWithEnumProperty: OuterObjectWithEnumProperty; +} + +export interface TestAdditionalPropertiesReferenceRequest { + requestBody: { [key: string]: any; }; +} + +export interface TestBodyWithBinaryRequest { + body: Blob | null; +} + +export interface TestBodyWithFileSchemaRequest { + fileSchemaTestClass: FileSchemaTestClass; +} + +export interface TestBodyWithQueryParamsRequest { + query: string; + user: User; +} + +export interface TestClientModelRequest { + client: Client; +} + +export interface TestEndpointParametersRequest { + number: number; + _double: number; + patternWithoutDelimiter: string; + _byte: string; + integer?: number; + int32?: number; + int64?: number; + _float?: number; + string?: string; + binary?: Blob; + date?: Date; + dateTime?: Date; + password?: string; + callback?: string; +} + +export interface TestEnumParametersRequest { + enumHeaderStringArray?: Array; + enumHeaderString?: TestEnumParametersEnumHeaderStringEnum; + enumQueryStringArray?: Array; + enumQueryString?: TestEnumParametersEnumQueryStringEnum; + enumQueryInteger?: TestEnumParametersEnumQueryIntegerEnum; + enumQueryDouble?: TestEnumParametersEnumQueryDoubleEnum; + enumQueryModelArray?: Array; + enumFormStringArray?: Array; + enumFormString?: TestEnumParametersEnumFormStringEnum; +} + +export interface TestGroupParametersRequest { + requiredStringGroup: number; + requiredBooleanGroup: boolean; + requiredInt64Group: number; + stringGroup?: number; + booleanGroup?: boolean; + int64Group?: number; +} + +export interface TestInlineAdditionalPropertiesRequest { + requestBody: { [key: string]: string; }; +} + +export interface TestInlineFreeformAdditionalPropertiesOperationRequest { + testInlineFreeformAdditionalPropertiesRequest: TestInlineFreeformAdditionalPropertiesRequest; +} + +export interface TestJsonFormDataRequest { + param: string; + param2: string; +} + +export interface TestNullableRequest { + childWithNullable: ChildWithNullable; +} + +export interface TestQueryParameterCollectionFormatRequest { + pipe: Array; + ioutil: Array; + http: Array; + url: Array; + context: Array; + allowEmpty: string; + language?: { [key: string]: string; }; +} + +export interface TestStringMapReferenceRequest { + requestBody: { [key: string]: string; }; +} + +/** + * + */ +export class FakeApi extends runtime.BaseAPI { + + /** + * Creates request options for fakeBigDecimalMap without sending the request + */ + async fakeBigDecimalMapRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/fake/BigDecimalMap`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + async fakeBigDecimalMapRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fakeBigDecimalMapRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FakeBigDecimalMap200ResponseFromJSON(jsonValue)); + } + + /** + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + */ + async fakeBigDecimalMap(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fakeBigDecimalMapRaw(initOverrides); + return await response.value(); + } + + /** + * Creates request options for fakeHealthGet without sending the request + */ + async fakeHealthGetRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/fake/health`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Health check endpoint + */ + async fakeHealthGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fakeHealthGetRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => HealthCheckResultFromJSON(jsonValue)); + } + + /** + * Health check endpoint + */ + async fakeHealthGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fakeHealthGetRaw(initOverrides); + return await response.value(); + } + + /** + * Creates request options for fakeHttpSignatureTest without sending the request + */ + async fakeHttpSignatureTestRequestOpts(requestParameters: FakeHttpSignatureTestRequest): Promise { + if (requestParameters['pet'] == null) { + throw new runtime.RequiredError( + 'pet', + 'Required parameter "pet" was null or undefined when calling fakeHttpSignatureTest().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['query1'] != null) { + queryParameters['query_1'] = requestParameters['query1']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['header1'] != null) { + headerParameters['header_1'] = String(requestParameters['header1']); + } + + + let urlPath = `/fake/http-signature-test`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + body: PetToJSON(requestParameters['pet']), + }; + } + + /** + * test http signature authentication + */ + async fakeHttpSignatureTestRaw(requestParameters: FakeHttpSignatureTestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fakeHttpSignatureTestRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * test http signature authentication + */ + async fakeHttpSignatureTest(requestParameters: FakeHttpSignatureTestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.fakeHttpSignatureTestRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for fakeOuterBooleanSerialize without sending the request + */ + async fakeOuterBooleanSerializeRequestOpts(requestParameters: FakeOuterBooleanSerializeRequest): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/outer/boolean`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }; + } + + /** + * Test serialization of outer boolean types + */ + async fakeOuterBooleanSerializeRaw(requestParameters: FakeOuterBooleanSerializeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fakeOuterBooleanSerializeRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Test serialization of outer boolean types + */ + async fakeOuterBooleanSerialize(requestParameters: FakeOuterBooleanSerializeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fakeOuterBooleanSerializeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for fakeOuterCompositeSerialize without sending the request + */ + async fakeOuterCompositeSerializeRequestOpts(requestParameters: FakeOuterCompositeSerializeRequest): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/outer/composite`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OuterCompositeToJSON(requestParameters['outerComposite']), + }; + } + + /** + * Test serialization of object with outer number type + */ + async fakeOuterCompositeSerializeRaw(requestParameters: FakeOuterCompositeSerializeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fakeOuterCompositeSerializeRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OuterCompositeFromJSON(jsonValue)); + } + + /** + * Test serialization of object with outer number type + */ + async fakeOuterCompositeSerialize(requestParameters: FakeOuterCompositeSerializeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fakeOuterCompositeSerializeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for fakeOuterNumberSerialize without sending the request + */ + async fakeOuterNumberSerializeRequestOpts(requestParameters: FakeOuterNumberSerializeRequest): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/outer/number`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }; + } + + /** + * Test serialization of outer number types + */ + async fakeOuterNumberSerializeRaw(requestParameters: FakeOuterNumberSerializeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fakeOuterNumberSerializeRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Test serialization of outer number types + */ + async fakeOuterNumberSerialize(requestParameters: FakeOuterNumberSerializeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fakeOuterNumberSerializeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for fakeOuterStringSerialize without sending the request + */ + async fakeOuterStringSerializeRequestOpts(requestParameters: FakeOuterStringSerializeRequest): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/outer/string`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }; + } + + /** + * Test serialization of outer string types + */ + async fakeOuterStringSerializeRaw(requestParameters: FakeOuterStringSerializeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fakeOuterStringSerializeRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Test serialization of outer string types + */ + async fakeOuterStringSerialize(requestParameters: FakeOuterStringSerializeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fakeOuterStringSerializeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for fakePropertyEnumIntegerSerialize without sending the request + */ + async fakePropertyEnumIntegerSerializeRequestOpts(requestParameters: FakePropertyEnumIntegerSerializeRequest): Promise { + if (requestParameters['outerObjectWithEnumProperty'] == null) { + throw new runtime.RequiredError( + 'outerObjectWithEnumProperty', + 'Required parameter "outerObjectWithEnumProperty" was null or undefined when calling fakePropertyEnumIntegerSerialize().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/property/enum-int`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OuterObjectWithEnumPropertyToJSON(requestParameters['outerObjectWithEnumProperty']), + }; + } + + /** + * Test serialization of enum (int) properties with examples + */ + async fakePropertyEnumIntegerSerializeRaw(requestParameters: FakePropertyEnumIntegerSerializeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.fakePropertyEnumIntegerSerializeRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OuterObjectWithEnumPropertyFromJSON(jsonValue)); + } + + /** + * Test serialization of enum (int) properties with examples + */ + async fakePropertyEnumIntegerSerialize(requestParameters: FakePropertyEnumIntegerSerializeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fakePropertyEnumIntegerSerializeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for testAdditionalPropertiesReference without sending the request + */ + async testAdditionalPropertiesReferenceRequestOpts(requestParameters: TestAdditionalPropertiesReferenceRequest): Promise { + if (requestParameters['requestBody'] == null) { + throw new runtime.RequiredError( + 'requestBody', + 'Required parameter "requestBody" was null or undefined when calling testAdditionalPropertiesReference().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/additionalProperties-reference`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody'], + }; + } + + /** + * + * test referenced additionalProperties + */ + async testAdditionalPropertiesReferenceRaw(requestParameters: TestAdditionalPropertiesReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testAdditionalPropertiesReferenceRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * test referenced additionalProperties + */ + async testAdditionalPropertiesReference(requestParameters: TestAdditionalPropertiesReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testAdditionalPropertiesReferenceRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testBodyWithBinary without sending the request + */ + async testBodyWithBinaryRequestOpts(requestParameters: TestBodyWithBinaryRequest): Promise { + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling testBodyWithBinary().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'image/png'; + + + let urlPath = `/fake/body-with-binary`; + + return { + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: requestParameters['body'] as any, + }; + } + + /** + * For this test, the body has to be a binary file. + */ + async testBodyWithBinaryRaw(requestParameters: TestBodyWithBinaryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testBodyWithBinaryRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * For this test, the body has to be a binary file. + */ + async testBodyWithBinary(requestParameters: TestBodyWithBinaryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testBodyWithBinaryRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testBodyWithFileSchema without sending the request + */ + async testBodyWithFileSchemaRequestOpts(requestParameters: TestBodyWithFileSchemaRequest): Promise { + if (requestParameters['fileSchemaTestClass'] == null) { + throw new runtime.RequiredError( + 'fileSchemaTestClass', + 'Required parameter "fileSchemaTestClass" was null or undefined when calling testBodyWithFileSchema().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/body-with-file-schema`; + + return { + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: FileSchemaTestClassToJSON(requestParameters['fileSchemaTestClass']), + }; + } + + /** + * For this test, the body for this request must reference a schema named `File`. + */ + async testBodyWithFileSchemaRaw(requestParameters: TestBodyWithFileSchemaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testBodyWithFileSchemaRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * For this test, the body for this request must reference a schema named `File`. + */ + async testBodyWithFileSchema(requestParameters: TestBodyWithFileSchemaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testBodyWithFileSchemaRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testBodyWithQueryParams without sending the request + */ + async testBodyWithQueryParamsRequestOpts(requestParameters: TestBodyWithQueryParamsRequest): Promise { + if (requestParameters['query'] == null) { + throw new runtime.RequiredError( + 'query', + 'Required parameter "query" was null or undefined when calling testBodyWithQueryParams().' + ); + } + + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling testBodyWithQueryParams().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/body-with-query-params`; + + return { + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters['user']), + }; + } + + /** + */ + async testBodyWithQueryParamsRaw(requestParameters: TestBodyWithQueryParamsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testBodyWithQueryParamsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + */ + async testBodyWithQueryParams(requestParameters: TestBodyWithQueryParamsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testBodyWithQueryParamsRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testClientModel without sending the request + */ + async testClientModelRequestOpts(requestParameters: TestClientModelRequest): Promise { + if (requestParameters['client'] == null) { + throw new runtime.RequiredError( + 'client', + 'Required parameter "client" was null or undefined when calling testClientModel().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake`; + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: ClientToJSON(requestParameters['client']), + }; + } + + /** + * To test \"client\" model + * To test \"client\" model + */ + async testClientModelRaw(requestParameters: TestClientModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testClientModelRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ClientFromJSON(jsonValue)); + } + + /** + * To test \"client\" model + * To test \"client\" model + */ + async testClientModel(requestParameters: TestClientModelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.testClientModelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for testEndpointParameters without sending the request + */ + async testEndpointParametersRequestOpts(requestParameters: TestEndpointParametersRequest): Promise { + if (requestParameters['number'] == null) { + throw new runtime.RequiredError( + 'number', + 'Required parameter "number" was null or undefined when calling testEndpointParameters().' + ); + } + + if (requestParameters['_double'] == null) { + throw new runtime.RequiredError( + '_double', + 'Required parameter "_double" was null or undefined when calling testEndpointParameters().' + ); + } + + if (requestParameters['patternWithoutDelimiter'] == null) { + throw new runtime.RequiredError( + 'patternWithoutDelimiter', + 'Required parameter "patternWithoutDelimiter" was null or undefined when calling testEndpointParameters().' + ); + } + + if (requestParameters['_byte'] == null) { + throw new runtime.RequiredError( + '_byte', + 'Required parameter "_byte" was null or undefined when calling testEndpointParameters().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) { + headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password); + } + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['integer'] != null) { + formParams.append('integer', requestParameters['integer'] as any); + } + + if (requestParameters['int32'] != null) { + formParams.append('int32', requestParameters['int32'] as any); + } + + if (requestParameters['int64'] != null) { + formParams.append('int64', requestParameters['int64'] as any); + } + + if (requestParameters['number'] != null) { + formParams.append('number', requestParameters['number'] as any); + } + + if (requestParameters['_float'] != null) { + formParams.append('float', requestParameters['_float'] as any); + } + + if (requestParameters['_double'] != null) { + formParams.append('double', requestParameters['_double'] as any); + } + + if (requestParameters['string'] != null) { + formParams.append('string', requestParameters['string'] as any); + } + + if (requestParameters['patternWithoutDelimiter'] != null) { + formParams.append('pattern_without_delimiter', requestParameters['patternWithoutDelimiter'] as any); + } + + if (requestParameters['_byte'] != null) { + formParams.append('byte', requestParameters['_byte'] as any); + } + + if (requestParameters['binary'] != null) { + formParams.append('binary', requestParameters['binary'] as any); + } + + if (requestParameters['date'] != null) { + formParams.append('date', requestParameters['date'] as any); + } + + if (requestParameters['dateTime'] != null) { + formParams.append('dateTime', (requestParameters['dateTime'] as any).toISOString()); + } + + if (requestParameters['password'] != null) { + formParams.append('password', requestParameters['password'] as any); + } + + if (requestParameters['callback'] != null) { + formParams.append('callback', requestParameters['callback'] as any); + } + + + let urlPath = `/fake`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + */ + async testEndpointParametersRaw(requestParameters: TestEndpointParametersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testEndpointParametersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + */ + async testEndpointParameters(requestParameters: TestEndpointParametersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testEndpointParametersRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testEnumParameters without sending the request + */ + async testEnumParametersRequestOpts(requestParameters: TestEnumParametersRequest): Promise { + const queryParameters: any = {}; + + if (requestParameters['enumQueryStringArray'] != null) { + queryParameters['enum_query_string_array'] = requestParameters['enumQueryStringArray']; + } + + if (requestParameters['enumQueryString'] != null) { + queryParameters['enum_query_string'] = requestParameters['enumQueryString']; + } + + if (requestParameters['enumQueryInteger'] != null) { + queryParameters['enum_query_integer'] = requestParameters['enumQueryInteger']; + } + + if (requestParameters['enumQueryDouble'] != null) { + queryParameters['enum_query_double'] = requestParameters['enumQueryDouble']; + } + + if (requestParameters['enumQueryModelArray'] != null) { + queryParameters['enum_query_model_array'] = requestParameters['enumQueryModelArray']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['enumHeaderStringArray'] != null) { + headerParameters['enum_header_string_array'] = requestParameters['enumHeaderStringArray']!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['enumHeaderString'] != null) { + headerParameters['enum_header_string'] = String(requestParameters['enumHeaderString']); + } + + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['enumFormStringArray'] != null) { + formParams.append('enum_form_string_array', requestParameters['enumFormStringArray']!.join(runtime.COLLECTION_FORMATS["csv"])); + } + + if (requestParameters['enumFormString'] != null) { + formParams.append('enum_form_string', requestParameters['enumFormString'] as any); + } + + + let urlPath = `/fake`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * To test enum parameters + * To test enum parameters + */ + async testEnumParametersRaw(requestParameters: TestEnumParametersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testEnumParametersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * To test enum parameters + * To test enum parameters + */ + async testEnumParameters(requestParameters: TestEnumParametersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testEnumParametersRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testGroupParameters without sending the request + */ + async testGroupParametersRequestOpts(requestParameters: TestGroupParametersRequest): Promise { + if (requestParameters['requiredStringGroup'] == null) { + throw new runtime.RequiredError( + 'requiredStringGroup', + 'Required parameter "requiredStringGroup" was null or undefined when calling testGroupParameters().' + ); + } + + if (requestParameters['requiredBooleanGroup'] == null) { + throw new runtime.RequiredError( + 'requiredBooleanGroup', + 'Required parameter "requiredBooleanGroup" was null or undefined when calling testGroupParameters().' + ); + } + + if (requestParameters['requiredInt64Group'] == null) { + throw new runtime.RequiredError( + 'requiredInt64Group', + 'Required parameter "requiredInt64Group" was null or undefined when calling testGroupParameters().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['requiredStringGroup'] != null) { + queryParameters['required_string_group'] = requestParameters['requiredStringGroup']; + } + + if (requestParameters['requiredInt64Group'] != null) { + queryParameters['required_int64_group'] = requestParameters['requiredInt64Group']; + } + + if (requestParameters['stringGroup'] != null) { + queryParameters['string_group'] = requestParameters['stringGroup']; + } + + if (requestParameters['int64Group'] != null) { + queryParameters['int64_group'] = requestParameters['int64Group']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['requiredBooleanGroup'] != null) { + headerParameters['required_boolean_group'] = String(requestParameters['requiredBooleanGroup']); + } + + if (requestParameters['booleanGroup'] != null) { + headerParameters['boolean_group'] = String(requestParameters['booleanGroup']); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("bearer_test", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/fake`; + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + */ + async testGroupParametersRaw(requestParameters: TestGroupParametersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testGroupParametersRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + */ + async testGroupParameters(requestParameters: TestGroupParametersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testGroupParametersRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testInlineAdditionalProperties without sending the request + */ + async testInlineAdditionalPropertiesRequestOpts(requestParameters: TestInlineAdditionalPropertiesRequest): Promise { + if (requestParameters['requestBody'] == null) { + throw new runtime.RequiredError( + 'requestBody', + 'Required parameter "requestBody" was null or undefined when calling testInlineAdditionalProperties().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/inline-additionalProperties`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody'], + }; + } + + /** + * + * test inline additionalProperties + */ + async testInlineAdditionalPropertiesRaw(requestParameters: TestInlineAdditionalPropertiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testInlineAdditionalPropertiesRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * test inline additionalProperties + */ + async testInlineAdditionalProperties(requestParameters: TestInlineAdditionalPropertiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testInlineAdditionalPropertiesRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testInlineFreeformAdditionalProperties without sending the request + */ + async testInlineFreeformAdditionalPropertiesRequestOpts(requestParameters: TestInlineFreeformAdditionalPropertiesOperationRequest): Promise { + if (requestParameters['testInlineFreeformAdditionalPropertiesRequest'] == null) { + throw new runtime.RequiredError( + 'testInlineFreeformAdditionalPropertiesRequest', + 'Required parameter "testInlineFreeformAdditionalPropertiesRequest" was null or undefined when calling testInlineFreeformAdditionalProperties().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/inline-freeform-additionalProperties`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: TestInlineFreeformAdditionalPropertiesRequestToJSON(requestParameters['testInlineFreeformAdditionalPropertiesRequest']), + }; + } + + /** + * + * test inline free-form additionalProperties + */ + async testInlineFreeformAdditionalPropertiesRaw(requestParameters: TestInlineFreeformAdditionalPropertiesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testInlineFreeformAdditionalPropertiesRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * test inline free-form additionalProperties + */ + async testInlineFreeformAdditionalProperties(requestParameters: TestInlineFreeformAdditionalPropertiesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testInlineFreeformAdditionalPropertiesRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testJsonFormData without sending the request + */ + async testJsonFormDataRequestOpts(requestParameters: TestJsonFormDataRequest): Promise { + if (requestParameters['param'] == null) { + throw new runtime.RequiredError( + 'param', + 'Required parameter "param" was null or undefined when calling testJsonFormData().' + ); + } + + if (requestParameters['param2'] == null) { + throw new runtime.RequiredError( + 'param2', + 'Required parameter "param2" was null or undefined when calling testJsonFormData().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['param'] != null) { + formParams.append('param', requestParameters['param'] as any); + } + + if (requestParameters['param2'] != null) { + formParams.append('param2', requestParameters['param2'] as any); + } + + + let urlPath = `/fake/jsonFormData`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * + * test json serialization of form data + */ + async testJsonFormDataRaw(requestParameters: TestJsonFormDataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testJsonFormDataRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * test json serialization of form data + */ + async testJsonFormData(requestParameters: TestJsonFormDataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testJsonFormDataRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testNullable without sending the request + */ + async testNullableRequestOpts(requestParameters: TestNullableRequest): Promise { + if (requestParameters['childWithNullable'] == null) { + throw new runtime.RequiredError( + 'childWithNullable', + 'Required parameter "childWithNullable" was null or undefined when calling testNullable().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/nullable`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ChildWithNullableToJSON(requestParameters['childWithNullable']), + }; + } + + /** + * + * test nullable parent property + */ + async testNullableRaw(requestParameters: TestNullableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testNullableRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * test nullable parent property + */ + async testNullable(requestParameters: TestNullableRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testNullableRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testQueryParameterCollectionFormat without sending the request + */ + async testQueryParameterCollectionFormatRequestOpts(requestParameters: TestQueryParameterCollectionFormatRequest): Promise { + if (requestParameters['pipe'] == null) { + throw new runtime.RequiredError( + 'pipe', + 'Required parameter "pipe" was null or undefined when calling testQueryParameterCollectionFormat().' + ); + } + + if (requestParameters['ioutil'] == null) { + throw new runtime.RequiredError( + 'ioutil', + 'Required parameter "ioutil" was null or undefined when calling testQueryParameterCollectionFormat().' + ); + } + + if (requestParameters['http'] == null) { + throw new runtime.RequiredError( + 'http', + 'Required parameter "http" was null or undefined when calling testQueryParameterCollectionFormat().' + ); + } + + if (requestParameters['url'] == null) { + throw new runtime.RequiredError( + 'url', + 'Required parameter "url" was null or undefined when calling testQueryParameterCollectionFormat().' + ); + } + + if (requestParameters['context'] == null) { + throw new runtime.RequiredError( + 'context', + 'Required parameter "context" was null or undefined when calling testQueryParameterCollectionFormat().' + ); + } + + if (requestParameters['allowEmpty'] == null) { + throw new runtime.RequiredError( + 'allowEmpty', + 'Required parameter "allowEmpty" was null or undefined when calling testQueryParameterCollectionFormat().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['pipe'] != null) { + queryParameters['pipe'] = requestParameters['pipe']!.join(runtime.COLLECTION_FORMATS["pipes"]); + } + + if (requestParameters['ioutil'] != null) { + queryParameters['ioutil'] = requestParameters['ioutil']!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['http'] != null) { + queryParameters['http'] = requestParameters['http']!.join(runtime.COLLECTION_FORMATS["ssv"]); + } + + if (requestParameters['url'] != null) { + queryParameters['url'] = requestParameters['url']!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + if (requestParameters['context'] != null) { + queryParameters['context'] = requestParameters['context']; + } + + if (requestParameters['language'] != null) { + for (let key of Object.keys(requestParameters['language'])) { + queryParameters[key] = requestParameters['language'][key]; + } + } + + if (requestParameters['allowEmpty'] != null) { + queryParameters['allowEmpty'] = requestParameters['allowEmpty']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/fake/test-query-parameters`; + + return { + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * To test the collection format in query parameters + */ + async testQueryParameterCollectionFormatRaw(requestParameters: TestQueryParameterCollectionFormatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testQueryParameterCollectionFormatRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * To test the collection format in query parameters + */ + async testQueryParameterCollectionFormat(requestParameters: TestQueryParameterCollectionFormatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testQueryParameterCollectionFormatRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for testStringMapReference without sending the request + */ + async testStringMapReferenceRequestOpts(requestParameters: TestStringMapReferenceRequest): Promise { + if (requestParameters['requestBody'] == null) { + throw new runtime.RequiredError( + 'requestBody', + 'Required parameter "requestBody" was null or undefined when calling testStringMapReference().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/fake/stringMap-reference`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody'], + }; + } + + /** + * + * test referenced string map + */ + async testStringMapReferenceRaw(requestParameters: TestStringMapReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testStringMapReferenceRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * test referenced string map + */ + async testStringMapReference(requestParameters: TestStringMapReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.testStringMapReferenceRaw(requestParameters, initOverrides); + } + +} + +/** + * @export + */ +export const TestEnumParametersEnumHeaderStringArrayEnum = { + GreaterThan: '>', + Dollar: '$' +} as const; +export type TestEnumParametersEnumHeaderStringArrayEnum = typeof TestEnumParametersEnumHeaderStringArrayEnum[keyof typeof TestEnumParametersEnumHeaderStringArrayEnum]; +/** + * @export + */ +export const TestEnumParametersEnumHeaderStringEnum = { + Abc: '_abc', + Efg: '-efg', + Xyz: '(xyz)' +} as const; +export type TestEnumParametersEnumHeaderStringEnum = typeof TestEnumParametersEnumHeaderStringEnum[keyof typeof TestEnumParametersEnumHeaderStringEnum]; +/** + * @export + */ +export const TestEnumParametersEnumQueryStringArrayEnum = { + GreaterThan: '>', + Dollar: '$' +} as const; +export type TestEnumParametersEnumQueryStringArrayEnum = typeof TestEnumParametersEnumQueryStringArrayEnum[keyof typeof TestEnumParametersEnumQueryStringArrayEnum]; +/** + * @export + */ +export const TestEnumParametersEnumQueryStringEnum = { + Abc: '_abc', + Efg: '-efg', + Xyz: '(xyz)' +} as const; +export type TestEnumParametersEnumQueryStringEnum = typeof TestEnumParametersEnumQueryStringEnum[keyof typeof TestEnumParametersEnumQueryStringEnum]; +/** + * @export + */ +export const TestEnumParametersEnumQueryIntegerEnum = { + NUMBER_1: 1, + NUMBER_MINUS_2: -2 +} as const; +export type TestEnumParametersEnumQueryIntegerEnum = typeof TestEnumParametersEnumQueryIntegerEnum[keyof typeof TestEnumParametersEnumQueryIntegerEnum]; +/** + * @export + */ +export const TestEnumParametersEnumQueryDoubleEnum = { + NUMBER_1_DOT_1: 1.1, + NUMBER_MINUS_1_DOT_2: -1.2 +} as const; +export type TestEnumParametersEnumQueryDoubleEnum = typeof TestEnumParametersEnumQueryDoubleEnum[keyof typeof TestEnumParametersEnumQueryDoubleEnum]; +/** + * @export + */ +export const TestEnumParametersEnumFormStringArrayEnum = { + GreaterThan: '>', + Dollar: '$' +} as const; +export type TestEnumParametersEnumFormStringArrayEnum = typeof TestEnumParametersEnumFormStringArrayEnum[keyof typeof TestEnumParametersEnumFormStringArrayEnum]; +/** + * @export + */ +export const TestEnumParametersEnumFormStringEnum = { + Abc: '_abc', + Efg: '-efg', + Xyz: '(xyz)' +} as const; +export type TestEnumParametersEnumFormStringEnum = typeof TestEnumParametersEnumFormStringEnum[keyof typeof TestEnumParametersEnumFormStringEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-classname-tags123-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-classname-tags123-api.ts new file mode 100644 index 000000000000..498566a7b6ac --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/fake-classname-tags123-api.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 Client, + ClientFromJSON, + ClientToJSON, +} from '../models/client'; + +export interface TestClassnameRequest { + client: Client; +} + +/** + * + */ +export class FakeClassnameTags123Api extends runtime.BaseAPI { + + /** + * Creates request options for testClassname without sending the request + */ + async testClassnameRequestOpts(requestParameters: TestClassnameRequest): Promise { + if (requestParameters['client'] == null) { + throw new runtime.RequiredError( + 'client', + 'Required parameter "client" was null or undefined when calling testClassname().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + queryParameters["api_key_query"] = await this.configuration.apiKey("api_key_query"); // api_key_query authentication + } + + + let urlPath = `/fake_classname_test`; + + return { + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: ClientToJSON(requestParameters['client']), + }; + } + + /** + * To test class name in snake case + * To test class name in snake case + */ + async testClassnameRaw(requestParameters: TestClassnameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.testClassnameRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ClientFromJSON(jsonValue)); + } + + /** + * To test class name in snake case + * To test class name in snake case + */ + async testClassname(requestParameters: TestClassnameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.testClassnameRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/index.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/index.ts new file mode 100644 index 000000000000..972efe4b8e43 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/index.ts @@ -0,0 +1,9 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './another-fake-api'; +export * from './default-api'; +export * from './fake-api'; +export * from './fake-classname-tags123-api'; +export * from './pet-api'; +export * from './store-api'; +export * from './user-api'; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/pet-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/pet-api.ts new file mode 100644 index 000000000000..ee481189d650 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/pet-api.ts @@ -0,0 +1,645 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 ModelApiResponse, + ModelApiResponseFromJSON, + ModelApiResponseToJSON, +} from '../models/model-api-response'; +import { + type Pet, + PetFromJSON, + PetToJSON, +} from '../models/pet'; + +export interface AddPetRequest { + pet: Pet; +} + +export interface DeletePetRequest { + petId: number; + apiKey?: string; +} + +export interface FindPetsByStatusRequest { + status: Array; +} + +export interface FindPetsByTagsRequest { + tags: Set; +} + +export interface GetPetByIdRequest { + petId: number; +} + +export interface UpdatePetRequest { + pet: Pet; +} + +export interface UpdatePetWithFormRequest { + petId: number; + name?: string; + status?: string; +} + +export interface UploadFileRequest { + petId: number; + additionalMetadata?: string; + file?: Blob; +} + +export interface UploadFileWithRequiredFileRequest { + petId: number; + requiredFile: Blob; + additionalMetadata?: string; +} + +/** + * + */ +export class PetApi extends runtime.BaseAPI { + + /** + * Creates request options for addPet without sending the request + */ + async addPetRequestOpts(requestParameters: AddPetRequest): Promise { + if (requestParameters['pet'] == null) { + throw new runtime.RequiredError( + 'pet', + 'Required parameter "pet" was null or undefined when calling addPet().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } + + + let urlPath = `/pet`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PetToJSON(requestParameters['pet']), + }; + } + + /** + * + * Add a new pet to the store + */ + async addPetRaw(requestParameters: AddPetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.addPetRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * Add a new pet to the store + */ + async addPet(requestParameters: AddPetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.addPetRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deletePet without sending the request + */ + async deletePetRequestOpts(requestParameters: DeletePetRequest): Promise { + if (requestParameters['petId'] == null) { + throw new runtime.RequiredError( + 'petId', + 'Required parameter "petId" was null or undefined when calling deletePet().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['apiKey'] != null) { + headerParameters['api_key'] = String(requestParameters['apiKey']); + } + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } + + + let urlPath = `/pet/{petId}`; + urlPath = urlPath.replace('{petId}', encodeURIComponent(String(requestParameters['petId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * + * Deletes a pet + */ + async deletePetRaw(requestParameters: DeletePetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deletePetRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * Deletes a pet + */ + async deletePet(requestParameters: DeletePetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deletePetRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for findPetsByStatus without sending the request + */ + async findPetsByStatusRequestOpts(requestParameters: FindPetsByStatusRequest): Promise { + if (requestParameters['status'] == null) { + throw new runtime.RequiredError( + 'status', + 'Required parameter "status" was null or undefined when calling findPetsByStatus().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['status'] != null) { + queryParameters['status'] = requestParameters['status']!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } + + + let urlPath = `/pet/findByStatus`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ + async findPetsByStatusRaw(requestParameters: FindPetsByStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const requestOptions = await this.findPetsByStatusRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PetFromJSON)); + } + + /** + * Multiple status values can be provided with comma separated strings + * Finds Pets by status + */ + async findPetsByStatus(requestParameters: FindPetsByStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.findPetsByStatusRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for findPetsByTags without sending the request + * @deprecated + */ + async findPetsByTagsRequestOpts(requestParameters: FindPetsByTagsRequest): Promise { + if (requestParameters['tags'] == null) { + throw new runtime.RequiredError( + 'tags', + 'Required parameter "tags" was null or undefined when calling findPetsByTags().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['tags'] != null) { + queryParameters['tags'] = Array.from(requestParameters['tags'])!.join(runtime.COLLECTION_FORMATS["csv"]); + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } + + + let urlPath = `/pet/findByTags`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + * @deprecated + */ + async findPetsByTagsRaw(requestParameters: FindPetsByTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const requestOptions = await this.findPetsByTagsRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => new Set(jsonValue.map(PetFromJSON))); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags + * @deprecated + */ + async findPetsByTags(requestParameters: FindPetsByTagsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.findPetsByTagsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for getPetById without sending the request + */ + async getPetByIdRequestOpts(requestParameters: GetPetByIdRequest): Promise { + if (requestParameters['petId'] == null) { + throw new runtime.RequiredError( + 'petId', + 'Required parameter "petId" was null or undefined when calling getPetById().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication + } + + + let urlPath = `/pet/{petId}`; + urlPath = urlPath.replace('{petId}', encodeURIComponent(String(requestParameters['petId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Returns a single pet + * Find pet by ID + */ + async getPetByIdRaw(requestParameters: GetPetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getPetByIdRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => PetFromJSON(jsonValue)); + } + + /** + * Returns a single pet + * Find pet by ID + */ + async getPetById(requestParameters: GetPetByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getPetByIdRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for updatePet without sending the request + */ + async updatePetRequestOpts(requestParameters: UpdatePetRequest): Promise { + if (requestParameters['pet'] == null) { + throw new runtime.RequiredError( + 'pet', + 'Required parameter "pet" was null or undefined when calling updatePet().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } + + + let urlPath = `/pet`; + + return { + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: PetToJSON(requestParameters['pet']), + }; + } + + /** + * + * Update an existing pet + */ + async updatePetRaw(requestParameters: UpdatePetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updatePetRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * Update an existing pet + */ + async updatePet(requestParameters: UpdatePetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.updatePetRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for updatePetWithForm without sending the request + */ + async updatePetWithFormRequestOpts(requestParameters: UpdatePetWithFormRequest): Promise { + if (requestParameters['petId'] == null) { + throw new runtime.RequiredError( + 'petId', + 'Required parameter "petId" was null or undefined when calling updatePetWithForm().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } + + const consumes: runtime.Consume[] = [ + { contentType: 'application/x-www-form-urlencoded' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['name'] != null) { + formParams.append('name', requestParameters['name'] as any); + } + + if (requestParameters['status'] != null) { + formParams.append('status', requestParameters['status'] as any); + } + + + let urlPath = `/pet/{petId}`; + urlPath = urlPath.replace('{petId}', encodeURIComponent(String(requestParameters['petId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * + * Updates a pet in the store with form data + */ + async updatePetWithFormRaw(requestParameters: UpdatePetWithFormRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updatePetWithFormRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * Updates a pet in the store with form data + */ + async updatePetWithForm(requestParameters: UpdatePetWithFormRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.updatePetWithFormRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for uploadFile without sending the request + */ + async uploadFileRequestOpts(requestParameters: UploadFileRequest): Promise { + if (requestParameters['petId'] == null) { + throw new runtime.RequiredError( + 'petId', + 'Required parameter "petId" was null or undefined when calling uploadFile().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } + + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['additionalMetadata'] != null) { + formParams.append('additionalMetadata', requestParameters['additionalMetadata'] as any); + } + + if (requestParameters['file'] != null) { + formParams.append('file', requestParameters['file'] as any); + } + + + let urlPath = `/pet/{petId}/uploadImage`; + urlPath = urlPath.replace('{petId}', encodeURIComponent(String(requestParameters['petId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * + * uploads an image + */ + async uploadFileRaw(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.uploadFileRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); + } + + /** + * + * uploads an image + */ + async uploadFile(requestParameters: UploadFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.uploadFileRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for uploadFileWithRequiredFile without sending the request + */ + async uploadFileWithRequiredFileRequestOpts(requestParameters: UploadFileWithRequiredFileRequest): Promise { + if (requestParameters['petId'] == null) { + throw new runtime.RequiredError( + 'petId', + 'Required parameter "petId" was null or undefined when calling uploadFileWithRequiredFile().' + ); + } + + if (requestParameters['requiredFile'] == null) { + throw new runtime.RequiredError( + 'requiredFile', + 'Required parameter "requiredFile" was null or undefined when calling uploadFileWithRequiredFile().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("petstore_auth", ["write:pets", "read:pets"]); + } + + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['additionalMetadata'] != null) { + formParams.append('additionalMetadata', requestParameters['additionalMetadata'] as any); + } + + if (requestParameters['requiredFile'] != null) { + formParams.append('requiredFile', requestParameters['requiredFile'] as any); + } + + + let urlPath = `/fake/{petId}/uploadImageWithRequiredFile`; + urlPath = urlPath.replace('{petId}', encodeURIComponent(String(requestParameters['petId']))); + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }; + } + + /** + * + * uploads an image (required) + */ + async uploadFileWithRequiredFileRaw(requestParameters: UploadFileWithRequiredFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.uploadFileWithRequiredFileRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ModelApiResponseFromJSON(jsonValue)); + } + + /** + * + * uploads an image (required) + */ + async uploadFileWithRequiredFile(requestParameters: UploadFileWithRequiredFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.uploadFileWithRequiredFileRaw(requestParameters, initOverrides); + return await response.value(); + } + +} + +/** + * @export + */ +export const FindPetsByStatusStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; +export type FindPetsByStatusStatusEnum = typeof FindPetsByStatusStatusEnum[keyof typeof FindPetsByStatusStatusEnum]; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/store-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/store-api.ts new file mode 100644 index 000000000000..c5ac0c6732d8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/store-api.ts @@ -0,0 +1,224 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 Order, + OrderFromJSON, + OrderToJSON, +} from '../models/order'; + +export interface DeleteOrderRequest { + orderId: string; +} + +export interface GetOrderByIdRequest { + orderId: number; +} + +export interface PlaceOrderRequest { + order: Order; +} + +/** + * + */ +export class StoreApi extends runtime.BaseAPI { + + /** + * Creates request options for deleteOrder without sending the request + */ + async deleteOrderRequestOpts(requestParameters: DeleteOrderRequest): Promise { + if (requestParameters['orderId'] == null) { + throw new runtime.RequiredError( + 'orderId', + 'Required parameter "orderId" was null or undefined when calling deleteOrder().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/store/order/{order_id}`; + urlPath = urlPath.replace('{order_id}', encodeURIComponent(String(requestParameters['orderId']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ + async deleteOrderRaw(requestParameters: DeleteOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteOrderRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID + */ + async deleteOrder(requestParameters: DeleteOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteOrderRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getInventory without sending the request + */ + async getInventoryRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication + } + + + let urlPath = `/store/inventory`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ + async getInventoryRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getInventoryRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response); + } + + /** + * Returns a map of status codes to quantities + * Returns pet inventories by status + */ + async getInventory(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: number; }> { + const response = await this.getInventoryRaw(initOverrides); + return await response.value(); + } + + /** + * Creates request options for getOrderById without sending the request + */ + async getOrderByIdRequestOpts(requestParameters: GetOrderByIdRequest): Promise { + if (requestParameters['orderId'] == null) { + throw new runtime.RequiredError( + 'orderId', + 'Required parameter "orderId" was null or undefined when calling getOrderById().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/store/order/{order_id}`; + urlPath = urlPath.replace('{order_id}', encodeURIComponent(String(requestParameters['orderId']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * Find purchase order by ID + */ + async getOrderByIdRaw(requestParameters: GetOrderByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getOrderByIdRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * Find purchase order by ID + */ + async getOrderById(requestParameters: GetOrderByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getOrderByIdRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for placeOrder without sending the request + */ + async placeOrderRequestOpts(requestParameters: PlaceOrderRequest): Promise { + if (requestParameters['order'] == null) { + throw new runtime.RequiredError( + 'order', + 'Required parameter "order" was null or undefined when calling placeOrder().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/store/order`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OrderToJSON(requestParameters['order']), + }; + } + + /** + * + * Place an order for a pet + */ + async placeOrderRaw(requestParameters: PlaceOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.placeOrderRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OrderFromJSON(jsonValue)); + } + + /** + * + * Place an order for a pet + */ + async placeOrder(requestParameters: PlaceOrderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.placeOrderRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/user-api.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/user-api.ts new file mode 100644 index 000000000000..606f33655398 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/apis/user-api.ts @@ -0,0 +1,453 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 User, + UserFromJSON, + UserToJSON, +} from '../models/user'; + +export interface CreateUserRequest { + user: User; +} + +export interface CreateUsersWithArrayInputRequest { + user: Array; +} + +export interface CreateUsersWithListInputRequest { + user: Array; +} + +export interface DeleteUserRequest { + username: string; +} + +export interface GetUserByNameRequest { + username: string; +} + +export interface LoginUserRequest { + username: string; + password: string; +} + +export interface UpdateUserRequest { + username: string; + user: User; +} + +/** + * + */ +export class UserApi extends runtime.BaseAPI { + + /** + * Creates request options for createUser without sending the request + */ + async createUserRequestOpts(requestParameters: CreateUserRequest): Promise { + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling createUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/user`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters['user']), + }; + } + + /** + * This can only be done by the logged in user. + * Create user + */ + async createUserRaw(requestParameters: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Create user + */ + async createUser(requestParameters: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.createUserRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for createUsersWithArrayInput without sending the request + */ + async createUsersWithArrayInputRequestOpts(requestParameters: CreateUsersWithArrayInputRequest): Promise { + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling createUsersWithArrayInput().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/user/createWithArray`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['user']!.map(UserToJSON), + }; + } + + /** + * + * Creates list of users with given input array + */ + async createUsersWithArrayInputRaw(requestParameters: CreateUsersWithArrayInputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createUsersWithArrayInputRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * Creates list of users with given input array + */ + async createUsersWithArrayInput(requestParameters: CreateUsersWithArrayInputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.createUsersWithArrayInputRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for createUsersWithListInput without sending the request + */ + async createUsersWithListInputRequestOpts(requestParameters: CreateUsersWithListInputRequest): Promise { + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling createUsersWithListInput().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/user/createWithList`; + + return { + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: requestParameters['user']!.map(UserToJSON), + }; + } + + /** + * + * Creates list of users with given input array + */ + async createUsersWithListInputRaw(requestParameters: CreateUsersWithListInputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.createUsersWithListInputRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * Creates list of users with given input array + */ + async createUsersWithListInput(requestParameters: CreateUsersWithListInputRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.createUsersWithListInputRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for deleteUser without sending the request + */ + async deleteUserRequestOpts(requestParameters: DeleteUserRequest): Promise { + if (requestParameters['username'] == null) { + throw new runtime.RequiredError( + 'username', + 'Required parameter "username" was null or undefined when calling deleteUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/user/{username}`; + urlPath = urlPath.replace('{username}', encodeURIComponent(String(requestParameters['username']))); + + return { + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * This can only be done by the logged in user. + * Delete user + */ + async deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.deleteUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Delete user + */ + async deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.deleteUserRaw(requestParameters, initOverrides); + } + + /** + * Creates request options for getUserByName without sending the request + */ + async getUserByNameRequestOpts(requestParameters: GetUserByNameRequest): Promise { + if (requestParameters['username'] == null) { + throw new runtime.RequiredError( + 'username', + 'Required parameter "username" was null or undefined when calling getUserByName().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/user/{username}`; + urlPath = urlPath.replace('{username}', encodeURIComponent(String(requestParameters['username']))); + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * + * Get user by user name + */ + async getUserByNameRaw(requestParameters: GetUserByNameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.getUserByNameRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UserFromJSON(jsonValue)); + } + + /** + * + * Get user by user name + */ + async getUserByName(requestParameters: GetUserByNameRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getUserByNameRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for loginUser without sending the request + */ + async loginUserRequestOpts(requestParameters: LoginUserRequest): Promise { + if (requestParameters['username'] == null) { + throw new runtime.RequiredError( + 'username', + 'Required parameter "username" was null or undefined when calling loginUser().' + ); + } + + if (requestParameters['password'] == null) { + throw new runtime.RequiredError( + 'password', + 'Required parameter "password" was null or undefined when calling loginUser().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['username'] != null) { + queryParameters['username'] = requestParameters['username']; + } + + if (requestParameters['password'] != null) { + queryParameters['password'] = requestParameters['password']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/user/login`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * + * Logs user into the system + */ + async loginUserRaw(requestParameters: LoginUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.loginUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * + * Logs user into the system + */ + async loginUser(requestParameters: LoginUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.loginUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates request options for logoutUser without sending the request + */ + async logoutUserRequestOpts(): Promise { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/user/logout`; + + return { + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }; + } + + /** + * + * Logs out current logged in user session + */ + async logoutUserRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.logoutUserRequestOpts(); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * + * Logs out current logged in user session + */ + async logoutUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.logoutUserRaw(initOverrides); + } + + /** + * Creates request options for updateUser without sending the request + */ + async updateUserRequestOpts(requestParameters: UpdateUserRequest): Promise { + if (requestParameters['username'] == null) { + throw new runtime.RequiredError( + 'username', + 'Required parameter "username" was null or undefined when calling updateUser().' + ); + } + + if (requestParameters['user'] == null) { + throw new runtime.RequiredError( + 'user', + 'Required parameter "user" was null or undefined when calling updateUser().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + + let urlPath = `/user/{username}`; + urlPath = urlPath.replace('{username}', encodeURIComponent(String(requestParameters['username']))); + + return { + path: urlPath, + method: 'PUT', + headers: headerParameters, + query: queryParameters, + body: UserToJSON(requestParameters['user']), + }; + } + + /** + * This can only be done by the logged in user. + * Updated user + */ + async updateUserRaw(requestParameters: UpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const requestOptions = await this.updateUserRequestOpts(requestParameters); + const response = await this.request(requestOptions, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * This can only be done by the logged in user. + * Updated user + */ + async updateUser(requestParameters: UpdateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.updateUserRaw(requestParameters, initOverrides); + } + +} diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AdditionalPropertiesClass.md new file mode 100644 index 000000000000..57a49c2172f4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AdditionalPropertiesClass.md @@ -0,0 +1,36 @@ + +# AdditionalPropertiesClass + + +## Properties + +Name | Type +------------ | ------------- +`mapProperty` | { [key: string]: string; } +`mapOfMapProperty` | { [key: string]: { [key: string]: string; }; } + +## Example + +```typescript +import type { AdditionalPropertiesClass } from '' + +// TODO: Update the object below with actual values +const example = { + "mapProperty": null, + "mapOfMapProperty": null, +} satisfies AdditionalPropertiesClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AdditionalPropertiesClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AllOfWithSingleRef.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AllOfWithSingleRef.md new file mode 100644 index 000000000000..ac58cb9ac4a9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AllOfWithSingleRef.md @@ -0,0 +1,36 @@ + +# AllOfWithSingleRef + + +## Properties + +Name | Type +------------ | ------------- +`username` | string +`singleRefType` | [SingleRefType](SingleRefType.md) + +## Example + +```typescript +import type { AllOfWithSingleRef } from '' + +// TODO: Update the object below with actual values +const example = { + "username": null, + "singleRefType": null, +} satisfies AllOfWithSingleRef + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as AllOfWithSingleRef +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Animal.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Animal.md new file mode 100644 index 000000000000..c9340f7f3829 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Animal.md @@ -0,0 +1,36 @@ + +# Animal + + +## Properties + +Name | Type +------------ | ------------- +`className` | string +`color` | string + +## Example + +```typescript +import type { Animal } from '' + +// TODO: Update the object below with actual values +const example = { + "className": null, + "color": null, +} satisfies Animal + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Animal +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AnotherFakeApi.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AnotherFakeApi.md new file mode 100644 index 000000000000..0bbea8646ae4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/AnotherFakeApi.md @@ -0,0 +1,76 @@ +# 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 + +To test special tags and operation ID starting with number + +### Example + +```ts +import { + Configuration, + AnotherFakeApi, +} from ''; +import type { 123testSpecialTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new AnotherFakeApi(); + + const body = { + // Client | client model + client: ..., + } satisfies 123testSpecialTagsRequest; + + try { + const data = await api._123testSpecialTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 000000000000..be7f8c68a8d3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,34 @@ + +# ArrayOfArrayOfNumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`arrayArrayNumber` | Array<Array<number>> + +## Example + +```typescript +import type { ArrayOfArrayOfNumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayArrayNumber": null, +} satisfies ArrayOfArrayOfNumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayOfArrayOfNumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayOfNumberOnly.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayOfNumberOnly.md new file mode 100644 index 000000000000..5a45078ec80a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayOfNumberOnly.md @@ -0,0 +1,34 @@ + +# ArrayOfNumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`arrayNumber` | Array<number> + +## Example + +```typescript +import type { ArrayOfNumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayNumber": null, +} satisfies ArrayOfNumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayOfNumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayTest.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayTest.md new file mode 100644 index 000000000000..c96a28873389 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ArrayTest.md @@ -0,0 +1,38 @@ + +# ArrayTest + + +## Properties + +Name | Type +------------ | ------------- +`arrayOfString` | Array<string> +`arrayArrayOfInteger` | Array<Array<number>> +`arrayArrayOfModel` | Array<Array<ReadOnlyFirst>> + +## Example + +```typescript +import type { ArrayTest } from '' + +// TODO: Update the object below with actual values +const example = { + "arrayOfString": null, + "arrayArrayOfInteger": null, + "arrayArrayOfModel": null, +} satisfies ArrayTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ArrayTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Capitalization.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Capitalization.md new file mode 100644 index 000000000000..7295256c294d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Capitalization.md @@ -0,0 +1,44 @@ + +# Capitalization + + +## Properties + +Name | Type +------------ | ------------- +`smallCamel` | string +`capitalCamel` | string +`smallSnake` | string +`capitalSnake` | string +`sCAETHFlowPoints` | string +`aTTNAME` | string + +## Example + +```typescript +import type { Capitalization } from '' + +// TODO: Update the object below with actual values +const example = { + "smallCamel": null, + "capitalCamel": null, + "smallSnake": null, + "capitalSnake": null, + "sCAETHFlowPoints": null, + "aTTNAME": null, +} satisfies Capitalization + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Capitalization +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Cat.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Cat.md new file mode 100644 index 000000000000..c9af5916c1d7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Cat.md @@ -0,0 +1,34 @@ + +# Cat + + +## Properties + +Name | Type +------------ | ------------- +`declawed` | boolean + +## Example + +```typescript +import type { Cat } from '' + +// TODO: Update the object below with actual values +const example = { + "declawed": null, +} satisfies Cat + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Cat +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Category.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Category.md new file mode 100644 index 000000000000..a436c463edae --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Category.md @@ -0,0 +1,36 @@ + +# Category + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Category } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Category + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Category +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ChildWithNullable.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ChildWithNullable.md new file mode 100644 index 000000000000..21df9798d44d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ChildWithNullable.md @@ -0,0 +1,34 @@ + +# ChildWithNullable + + +## Properties + +Name | Type +------------ | ------------- +`otherProperty` | string + +## Example + +```typescript +import type { ChildWithNullable } from '' + +// TODO: Update the object below with actual values +const example = { + "otherProperty": null, +} satisfies ChildWithNullable + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ChildWithNullable +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ClassModel.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ClassModel.md new file mode 100644 index 000000000000..11e87e883716 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ClassModel.md @@ -0,0 +1,35 @@ + +# ClassModel + +Model for testing model with \"_class\" property + +## Properties + +Name | Type +------------ | ------------- +`_class` | string + +## Example + +```typescript +import type { ClassModel } from '' + +// TODO: Update the object below with actual values +const example = { + "_class": null, +} satisfies ClassModel + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ClassModel +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Client.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Client.md new file mode 100644 index 000000000000..a695e731d26d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Client.md @@ -0,0 +1,34 @@ + +# Client + + +## Properties + +Name | Type +------------ | ------------- +`client` | string + +## Example + +```typescript +import type { Client } from '' + +// TODO: Update the object below with actual values +const example = { + "client": null, +} satisfies Client + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Client +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/DefaultApi.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/DefaultApi.md new file mode 100644 index 000000000000..634c8687af1b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/DefaultApi.md @@ -0,0 +1,66 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**fooGet**](DefaultApi.md#fooget) | **GET** /foo | | + + + +## fooGet + +> FooGetDefaultResponse fooGet() + + + +### Example + +```ts +import { + Configuration, + DefaultApi, +} from ''; +import type { FooGetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new DefaultApi(); + + try { + const data = await api.fooGet(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FooGetDefaultResponse**](FooGetDefaultResponse.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/DeprecatedObject.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/DeprecatedObject.md new file mode 100644 index 000000000000..0205d848ea10 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/DeprecatedObject.md @@ -0,0 +1,34 @@ + +# DeprecatedObject + + +## Properties + +Name | Type +------------ | ------------- +`name` | string + +## Example + +```typescript +import type { DeprecatedObject } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, +} satisfies DeprecatedObject + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DeprecatedObject +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Dog.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Dog.md new file mode 100644 index 000000000000..7cec0ceeffaf --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Dog.md @@ -0,0 +1,34 @@ + +# Dog + + +## Properties + +Name | Type +------------ | ------------- +`breed` | string + +## Example + +```typescript +import type { Dog } from '' + +// TODO: Update the object below with actual values +const example = { + "breed": null, +} satisfies Dog + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Dog +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumArrays.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumArrays.md new file mode 100644 index 000000000000..ec959f362b4b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumArrays.md @@ -0,0 +1,36 @@ + +# EnumArrays + + +## Properties + +Name | Type +------------ | ------------- +`justSymbol` | string +`arrayEnum` | Array<string> + +## Example + +```typescript +import type { EnumArrays } from '' + +// TODO: Update the object below with actual values +const example = { + "justSymbol": null, + "arrayEnum": null, +} satisfies EnumArrays + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumArrays +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumClass.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumClass.md new file mode 100644 index 000000000000..eb421a41a1b4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumClass.md @@ -0,0 +1,32 @@ + +# EnumClass + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { EnumClass } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies EnumClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumTest.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumTest.md new file mode 100644 index 000000000000..4015a156ba48 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/EnumTest.md @@ -0,0 +1,48 @@ + +# EnumTest + + +## Properties + +Name | Type +------------ | ------------- +`enumString` | string +`enumStringRequired` | string +`enumInteger` | number +`enumNumber` | number +`outerEnum` | [OuterEnum](OuterEnum.md) +`outerEnumInteger` | [OuterEnumInteger](OuterEnumInteger.md) +`outerEnumDefaultValue` | [OuterEnumDefaultValue](OuterEnumDefaultValue.md) +`outerEnumIntegerDefaultValue` | [OuterEnumIntegerDefaultValue](OuterEnumIntegerDefaultValue.md) + +## Example + +```typescript +import type { EnumTest } from '' + +// TODO: Update the object below with actual values +const example = { + "enumString": null, + "enumStringRequired": null, + "enumInteger": null, + "enumNumber": null, + "outerEnum": null, + "outerEnumInteger": null, + "outerEnumDefaultValue": null, + "outerEnumIntegerDefaultValue": null, +} satisfies EnumTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as EnumTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeApi.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeApi.md new file mode 100644 index 000000000000..9a679499c16f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeApi.md @@ -0,0 +1,1605 @@ +# 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 | | +| [**testAdditionalPropertiesReference**](FakeApi.md#testadditionalpropertiesreference) | **POST** /fake/additionalProperties-reference | test referenced additionalProperties | +| [**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 | +| [**testInlineFreeformAdditionalProperties**](FakeApi.md#testinlinefreeformadditionalpropertiesoperation) | **POST** /fake/inline-freeform-additionalProperties | test inline free-form additionalProperties | +| [**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data | +| [**testNullable**](FakeApi.md#testnullable) | **POST** /fake/nullable | test nullable parent property | +| [**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | | +| [**testStringMapReference**](FakeApi.md#teststringmapreference) | **POST** /fake/stringMap-reference | test referenced string map | + + + +## fakeBigDecimalMap + +> FakeBigDecimalMap200Response fakeBigDecimalMap() + + + +for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeBigDecimalMapRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + try { + const data = await api.fakeBigDecimalMap(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**FakeBigDecimalMap200Response**](FakeBigDecimalMap200Response.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeHealthGet + +> HealthCheckResult fakeHealthGet() + +Health check endpoint + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeHealthGetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + try { + const data = await api.fakeHealthGet(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeHttpSignatureTest + +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeHttpSignatureTestRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP signature authorization: http_signature_test + headers: { "YOUR HEADER NAME": "YOUR SIGNATURE" }, + }); + const api = new FakeApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + // string | query parameter (optional) + query1: query1_example, + // string | header parameter (optional) + header1: header1_example, + } satisfies FakeHttpSignatureTestRequest; + + try { + const data = await api.fakeHttpSignatureTest(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | 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` (Empty response body) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterBooleanSerialize + +> boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterBooleanSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // boolean | Input boolean as post body (optional) + body: true, + } satisfies FakeOuterBooleanSerializeRequest; + + try { + const data = await api.fakeOuterBooleanSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `boolean` | Input boolean as post body | [Optional] | + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(outerComposite) + + + +Test serialization of object with outer number type + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterCompositeSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // OuterComposite | Input composite as post body (optional) + outerComposite: ..., + } satisfies FakeOuterCompositeSerializeRequest; + + try { + const data = await api.fakeOuterCompositeSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerComposite** | [OuterComposite](OuterComposite.md) | Input composite as post body | [Optional] | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterNumberSerialize + +> number fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterNumberSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // number | Input number as post body (optional) + body: 8.14, + } satisfies FakeOuterNumberSerializeRequest; + + try { + const data = await api.fakeOuterNumberSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `number` | Input number as post body | [Optional] | + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakeOuterStringSerialize + +> string fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakeOuterStringSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string | Input string as post body (optional) + body: body_example, + } satisfies FakeOuterStringSerializeRequest; + + try { + const data = await api.fakeOuterStringSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `string` | Input string as post body | [Optional] | + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## fakePropertyEnumIntegerSerialize + +> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) + + + +Test serialization of enum (int) properties with examples + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { FakePropertyEnumIntegerSerializeRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // OuterObjectWithEnumProperty | Input enum (int) as post body + outerObjectWithEnumProperty: ..., + } satisfies FakePropertyEnumIntegerSerializeRequest; + + try { + const data = await api.fakePropertyEnumIntegerSerialize(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **outerObjectWithEnumProperty** | [OuterObjectWithEnumProperty](OuterObjectWithEnumProperty.md) | Input enum (int) as post body | | + +### Return type + +[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testAdditionalPropertiesReference + +> testAdditionalPropertiesReference(requestBody) + +test referenced additionalProperties + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestAdditionalPropertiesReferenceRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // { [key: string]: any; } | request body + requestBody: Object, + } satisfies TestAdditionalPropertiesReferenceRequest; + + try { + const data = await api.testAdditionalPropertiesReference(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | `{ [key: string]: any; }` | request body | | + +### 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 | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithBinary + +> testBodyWithBinary(body) + + + +For this test, the body has to be a binary file. + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithBinaryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Blob | image to upload + body: BINARY_DATA_HERE, + } satisfies TestBodyWithBinaryRequest; + + try { + const data = await api.testBodyWithBinary(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | `Blob` | image to upload | | + +### Return type + +`void` (Empty response body) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithFileSchema + +> testBodyWithFileSchema(fileSchemaTestClass) + + + +For this test, the body for this request must reference a schema named `File`. + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithFileSchemaRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // FileSchemaTestClass + fileSchemaTestClass: ..., + } satisfies TestBodyWithFileSchemaRequest; + + try { + const data = await api.testBodyWithFileSchema(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **fileSchemaTestClass** | [FileSchemaTestClass](FileSchemaTestClass.md) | | | + +### 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 | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testBodyWithQueryParams + +> testBodyWithQueryParams(query, user) + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestBodyWithQueryParamsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string + query: query_example, + // User + user: ..., + } satisfies TestBodyWithQueryParamsRequest; + + try { + const data = await api.testBodyWithQueryParams(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **query** | `string` | | [Defaults to `undefined`] | +| **user** | [User](User.md) | | | + +### 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 | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testClientModel + +> Client testClientModel(client) + +To test \"client\" model + +To test \"client\" model + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestClientModelRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Client | client model + client: ..., + } satisfies TestClientModelRequest; + + try { + const data = await api.testClientModel(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testEndpointParameters + +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, callback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestEndpointParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure HTTP basic authorization: http_basic_test + username: "YOUR USERNAME", + password: "YOUR PASSWORD", + }); + const api = new FakeApi(config); + + const body = { + // number | None + number: 8.14, + // number | None + _double: 1.2, + // string | None + patternWithoutDelimiter: patternWithoutDelimiter_example, + // string | None + _byte: BYTE_ARRAY_DATA_HERE, + // number | None (optional) + integer: 56, + // number | None (optional) + int32: 56, + // number | None (optional) + int64: 789, + // number | None (optional) + _float: 3.4, + // string | None (optional) + string: string_example, + // Blob | None (optional) + binary: BINARY_DATA_HERE, + // Date | None (optional) + date: 2013-10-20, + // Date | None (optional) + dateTime: 2013-10-20T19:20:30+01:00, + // string | None (optional) + password: password_example, + // string | None (optional) + callback: callback_example, + } satisfies TestEndpointParametersRequest; + + try { + const data = await api.testEndpointParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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** | `Blob` | None | [Optional] [Defaults to `undefined`] | +| **date** | `Date` | 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testEnumParameters + +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestEnumParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Array<'>' | '$'> | Header parameter enum test (string array) (optional) + enumHeaderStringArray: ..., + // '_abc' | '-efg' | '(xyz)' | Header parameter enum test (string) (optional) + enumHeaderString: enumHeaderString_example, + // Array<'>' | '$'> | Query parameter enum test (string array) (optional) + enumQueryStringArray: ..., + // '_abc' | '-efg' | '(xyz)' | Query parameter enum test (string) (optional) + enumQueryString: enumQueryString_example, + // 1 | -2 | Query parameter enum test (double) (optional) + enumQueryInteger: 56, + // 1.1 | -1.2 | Query parameter enum test (double) (optional) + enumQueryDouble: 1.2, + // Array (optional) + enumQueryModelArray: ..., + // Array | Form parameter enum test (string array) (optional) + enumFormStringArray: ..., + // string | Form parameter enum test (string) (optional) + enumFormString: enumFormString_example, + } satisfies TestEnumParametersRequest; + + try { + const data = await api.testEnumParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **enumHeaderStringArray** | `>`, `$` | Header parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumHeaderString** | `_abc`, `-efg`, `(xyz)` | Header parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | +| **enumQueryStringArray** | `>`, `$` | Query parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumQueryString** | `_abc`, `-efg`, `(xyz)` | Query parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | +| **enumQueryInteger** | `1`, `-2` | Query parameter enum test (double) | [Optional] [Defaults to `undefined`] [Enum: 1, -2] | +| **enumQueryDouble** | `1.1`, `-1.2` | Query parameter enum test (double) | [Optional] [Defaults to `undefined`] [Enum: 1.1, -1.2] | +| **enumQueryModelArray** | `Array` | | [Optional] | +| **enumFormStringArray** | `>`, `$` | Form parameter enum test (string array) | [Optional] [Enum: >, $] | +| **enumFormString** | `_abc`, `-efg`, `(xyz)` | Form parameter enum test (string) | [Optional] [Defaults to `'-efg'`] [Enum: _abc, -efg, (xyz)] | + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testGroupParameters + +> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestGroupParametersRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // Configure HTTP bearer authorization: bearer_test + accessToken: "YOUR BEARER TOKEN", + }); + const api = new FakeApi(config); + + const body = { + // number | Required String in group parameters + requiredStringGroup: 56, + // boolean | Required Boolean in group parameters + requiredBooleanGroup: true, + // number | Required Integer in group parameters + requiredInt64Group: 789, + // number | String in group parameters (optional) + stringGroup: 56, + // boolean | Boolean in group parameters (optional) + booleanGroup: true, + // number | Integer in group parameters (optional) + int64Group: 789, + } satisfies TestGroupParametersRequest; + + try { + const data = await api.testGroupParameters(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testInlineAdditionalProperties + +> testInlineAdditionalProperties(requestBody) + +test inline additionalProperties + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestInlineAdditionalPropertiesRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // { [key: string]: string; } | request body + requestBody: ..., + } satisfies TestInlineAdditionalPropertiesRequest; + + try { + const data = await api.testInlineAdditionalProperties(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | `{ [key: string]: string; }` | request body | | + +### 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 | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testInlineFreeformAdditionalProperties + +> testInlineFreeformAdditionalProperties(testInlineFreeformAdditionalPropertiesRequest) + +test inline free-form additionalProperties + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestInlineFreeformAdditionalPropertiesOperationRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // TestInlineFreeformAdditionalPropertiesRequest | request body + testInlineFreeformAdditionalPropertiesRequest: ..., + } satisfies TestInlineFreeformAdditionalPropertiesOperationRequest; + + try { + const data = await api.testInlineFreeformAdditionalProperties(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **testInlineFreeformAdditionalPropertiesRequest** | [TestInlineFreeformAdditionalPropertiesRequest](TestInlineFreeformAdditionalPropertiesRequest.md) | request body | | + +### 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 | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testJsonFormData + +> testJsonFormData(param, param2) + +test json serialization of form data + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestJsonFormDataRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // string | field1 + param: param_example, + // string | field2 + param2: param2_example, + } satisfies TestJsonFormDataRequest; + + try { + const data = await api.testJsonFormData(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **param** | `string` | field1 | [Defaults to `undefined`] | +| **param2** | `string` | field2 | [Defaults to `undefined`] | + +### 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 | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testNullable + +> testNullable(childWithNullable) + +test nullable parent property + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestNullableRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // ChildWithNullable | request body + childWithNullable: ..., + } satisfies TestNullableRequest; + + try { + const data = await api.testNullable(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **childWithNullable** | [ChildWithNullable](ChildWithNullable.md) | request body | | + +### 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 | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) + + + +To test the collection format in query parameters + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestQueryParameterCollectionFormatRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // Array + pipe: ..., + // Array + ioutil: ..., + // Array + http: ..., + // Array + url: ..., + // Array + context: ..., + // string + allowEmpty: allowEmpty_example, + // { [key: string]: string; } (optional) + language: ..., + } satisfies TestQueryParameterCollectionFormatRequest; + + try { + const data = await api.testQueryParameterCollectionFormat(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pipe** | `Array` | | | +| **ioutil** | `Array` | | | +| **http** | `Array` | | | +| **url** | `Array` | | | +| **context** | `Array` | | | +| **allowEmpty** | `string` | | [Defaults to `undefined`] | +| **language** | `{ [key: string]: string; }` | | [Optional] | + +### 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 | +|-------------|-------------|------------------| +| **200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## testStringMapReference + +> testStringMapReference(requestBody) + +test referenced string map + + + +### Example + +```ts +import { + Configuration, + FakeApi, +} from ''; +import type { TestStringMapReferenceRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new FakeApi(); + + const body = { + // { [key: string]: string; } | request body + requestBody: ..., + } satisfies TestStringMapReferenceRequest; + + try { + const data = await api.testStringMapReference(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **requestBody** | `{ [key: string]: string; }` | request body | | + +### 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 | +|-------------|-------------|------------------| +| **200** | successful operation | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeBigDecimalMap200Response.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeBigDecimalMap200Response.md new file mode 100644 index 000000000000..55decbceae7a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeBigDecimalMap200Response.md @@ -0,0 +1,36 @@ + +# FakeBigDecimalMap200Response + + +## Properties + +Name | Type +------------ | ------------- +`someId` | number +`someMap` | { [key: string]: number; } + +## Example + +```typescript +import type { FakeBigDecimalMap200Response } from '' + +// TODO: Update the object below with actual values +const example = { + "someId": null, + "someMap": null, +} satisfies FakeBigDecimalMap200Response + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FakeBigDecimalMap200Response +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeClassnameTags123Api.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeClassnameTags123Api.md new file mode 100644 index 000000000000..f92fbbfdc5e6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FakeClassnameTags123Api.md @@ -0,0 +1,80 @@ +# 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 + +To test class name in snake case + +### Example + +```ts +import { + Configuration, + FakeClassnameTags123Api, +} from ''; +import type { TestClassnameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key_query + apiKey: "YOUR API KEY", + }); + const api = new FakeClassnameTags123Api(config); + + const body = { + // Client | client model + client: ..., + } satisfies TestClassnameRequest; + + try { + const data = await api.testClassname(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **client** | [Client](Client.md) | client model | | + +### Return type + +[**Client**](Client.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FileSchemaTestClass.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FileSchemaTestClass.md new file mode 100644 index 000000000000..0d8a01ce7744 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FileSchemaTestClass.md @@ -0,0 +1,36 @@ + +# FileSchemaTestClass + + +## Properties + +Name | Type +------------ | ------------- +`file` | any +`files` | Array<any> + +## Example + +```typescript +import type { FileSchemaTestClass } from '' + +// TODO: Update the object below with actual values +const example = { + "file": null, + "files": null, +} satisfies FileSchemaTestClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FileSchemaTestClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Foo.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Foo.md new file mode 100644 index 000000000000..9dc80038989e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Foo.md @@ -0,0 +1,34 @@ + +# Foo + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string + +## Example + +```typescript +import type { Foo } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, +} satisfies Foo + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Foo +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FooGetDefaultResponse.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FooGetDefaultResponse.md new file mode 100644 index 000000000000..142288f71a1b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FooGetDefaultResponse.md @@ -0,0 +1,34 @@ + +# FooGetDefaultResponse + + +## Properties + +Name | Type +------------ | ------------- +`string` | [Foo](Foo.md) + +## Example + +```typescript +import type { FooGetDefaultResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "string": null, +} satisfies FooGetDefaultResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FooGetDefaultResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FormatTest.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FormatTest.md new file mode 100644 index 000000000000..8c5381729918 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/FormatTest.md @@ -0,0 +1,64 @@ + +# FormatTest + + +## Properties + +Name | Type +------------ | ------------- +`integer` | number +`int32` | number +`int64` | number +`number` | number +`_float` | number +`_double` | number +`decimal` | string +`string` | string +`_byte` | string +`binary` | Blob +`date` | Date +`dateTime` | Date +`uuid` | string +`password` | string +`patternWithDigits` | string +`patternWithDigitsAndDelimiter` | string + +## Example + +```typescript +import type { FormatTest } from '' + +// TODO: Update the object below with actual values +const example = { + "integer": null, + "int32": null, + "int64": null, + "number": null, + "_float": null, + "_double": null, + "decimal": null, + "string": null, + "_byte": null, + "binary": null, + "date": null, + "dateTime": null, + "uuid": 72f98069-206d-4f12-9f12-3d1e525a8e84, + "password": null, + "patternWithDigits": null, + "patternWithDigitsAndDelimiter": null, +} satisfies FormatTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as FormatTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/HasOnlyReadOnly.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/HasOnlyReadOnly.md new file mode 100644 index 000000000000..5e4acb6fab84 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/HasOnlyReadOnly.md @@ -0,0 +1,36 @@ + +# HasOnlyReadOnly + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string +`foo` | string + +## Example + +```typescript +import type { HasOnlyReadOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, + "foo": null, +} satisfies HasOnlyReadOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as HasOnlyReadOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/HealthCheckResult.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/HealthCheckResult.md new file mode 100644 index 000000000000..e50fd4dc523a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/HealthCheckResult.md @@ -0,0 +1,35 @@ + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + +## Properties + +Name | Type +------------ | ------------- +`nullableMessage` | string + +## Example + +```typescript +import type { HealthCheckResult } from '' + +// TODO: Update the object below with actual values +const example = { + "nullableMessage": null, +} satisfies HealthCheckResult + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as HealthCheckResult +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/List.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/List.md new file mode 100644 index 000000000000..528de6c951e8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/List.md @@ -0,0 +1,34 @@ + +# List + + +## Properties + +Name | Type +------------ | ------------- +`_123list` | string + +## Example + +```typescript +import type { List } from '' + +// TODO: Update the object below with actual values +const example = { + "_123list": null, +} satisfies List + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as List +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/MapTest.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/MapTest.md new file mode 100644 index 000000000000..dfb73cded89a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/MapTest.md @@ -0,0 +1,40 @@ + +# MapTest + + +## Properties + +Name | Type +------------ | ------------- +`mapMapOfString` | { [key: string]: { [key: string]: string; }; } +`mapOfEnumString` | { [key: string]: string; } +`directMap` | { [key: string]: boolean; } +`indirectMap` | { [key: string]: boolean; } + +## Example + +```typescript +import type { MapTest } from '' + +// TODO: Update the object below with actual values +const example = { + "mapMapOfString": null, + "mapOfEnumString": null, + "directMap": null, + "indirectMap": null, +} satisfies MapTest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as MapTest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 000000000000..7113d7669471 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,38 @@ + +# MixedPropertiesAndAdditionalPropertiesClass + + +## Properties + +Name | Type +------------ | ------------- +`uuid` | string +`dateTime` | Date +`map` | [{ [key: string]: Animal; }](Animal.md) + +## Example + +```typescript +import type { MixedPropertiesAndAdditionalPropertiesClass } from '' + +// TODO: Update the object below with actual values +const example = { + "uuid": null, + "dateTime": null, + "map": null, +} satisfies MixedPropertiesAndAdditionalPropertiesClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as MixedPropertiesAndAdditionalPropertiesClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Model200Response.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Model200Response.md new file mode 100644 index 000000000000..b8c44438d1f8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Model200Response.md @@ -0,0 +1,37 @@ + +# Model200Response + +Model for testing model name starting with number + +## Properties + +Name | Type +------------ | ------------- +`name` | number +`_class` | string + +## Example + +```typescript +import type { Model200Response } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, + "_class": null, +} satisfies Model200Response + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Model200Response +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ModelApiResponse.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ModelApiResponse.md new file mode 100644 index 000000000000..c029285d2f1a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ModelApiResponse.md @@ -0,0 +1,38 @@ + +# ModelApiResponse + + +## Properties + +Name | Type +------------ | ------------- +`code` | number +`type` | string +`message` | string + +## Example + +```typescript +import type { ModelApiResponse } from '' + +// TODO: Update the object below with actual values +const example = { + "code": null, + "type": null, + "message": null, +} satisfies ModelApiResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelApiResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ModelFile.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ModelFile.md new file mode 100644 index 000000000000..c8d923e37bc4 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ModelFile.md @@ -0,0 +1,35 @@ + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type +------------ | ------------- +`sourceURI` | string + +## Example + +```typescript +import type { ModelFile } from '' + +// TODO: Update the object below with actual values +const example = { + "sourceURI": null, +} satisfies ModelFile + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ModelFile +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Name.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Name.md new file mode 100644 index 000000000000..8c8c48b60ed8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Name.md @@ -0,0 +1,41 @@ + +# Name + +Model for testing model name same as property name + +## Properties + +Name | Type +------------ | ------------- +`name` | number +`snakeCase` | number +`property` | string +`_123number` | number + +## Example + +```typescript +import type { Name } from '' + +// TODO: Update the object below with actual values +const example = { + "name": null, + "snakeCase": null, + "property": null, + "_123number": null, +} satisfies Name + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Name +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/NullableClass.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/NullableClass.md new file mode 100644 index 000000000000..70d7011287c9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/NullableClass.md @@ -0,0 +1,56 @@ + +# NullableClass + + +## Properties + +Name | Type +------------ | ------------- +`integerProp` | number +`numberProp` | number +`booleanProp` | boolean +`stringProp` | string +`dateProp` | Date +`datetimeProp` | Date +`arrayNullableProp` | Array<object> +`arrayAndItemsNullableProp` | Array<object | null> +`arrayItemsNullable` | Array<object | null> +`objectNullableProp` | { [key: string]: object; } +`objectAndItemsNullableProp` | { [key: string]: object | null; } +`objectItemsNullable` | { [key: string]: object | null; } + +## Example + +```typescript +import type { NullableClass } from '' + +// TODO: Update the object below with actual values +const example = { + "integerProp": null, + "numberProp": null, + "booleanProp": null, + "stringProp": null, + "dateProp": null, + "datetimeProp": null, + "arrayNullableProp": null, + "arrayAndItemsNullableProp": null, + "arrayItemsNullable": null, + "objectNullableProp": null, + "objectAndItemsNullableProp": null, + "objectItemsNullable": null, +} satisfies NullableClass + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as NullableClass +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/NumberOnly.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/NumberOnly.md new file mode 100644 index 000000000000..7a8a70f5c311 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/NumberOnly.md @@ -0,0 +1,34 @@ + +# NumberOnly + + +## Properties + +Name | Type +------------ | ------------- +`justNumber` | number + +## Example + +```typescript +import type { NumberOnly } from '' + +// TODO: Update the object below with actual values +const example = { + "justNumber": null, +} satisfies NumberOnly + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as NumberOnly +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ObjectWithDeprecatedFields.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ObjectWithDeprecatedFields.md new file mode 100644 index 000000000000..be78d0004a79 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ObjectWithDeprecatedFields.md @@ -0,0 +1,40 @@ + +# ObjectWithDeprecatedFields + + +## Properties + +Name | Type +------------ | ------------- +`uuid` | string +`id` | number +`deprecatedRef` | [DeprecatedObject](DeprecatedObject.md) +`bars` | Array<string> + +## Example + +```typescript +import type { ObjectWithDeprecatedFields } from '' + +// TODO: Update the object below with actual values +const example = { + "uuid": null, + "id": null, + "deprecatedRef": null, + "bars": null, +} satisfies ObjectWithDeprecatedFields + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ObjectWithDeprecatedFields +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Order.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Order.md new file mode 100644 index 000000000000..602f01d8d40f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Order.md @@ -0,0 +1,44 @@ + +# Order + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`petId` | number +`quantity` | number +`shipDate` | Date +`status` | string +`complete` | boolean + +## Example + +```typescript +import type { Order } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "petId": null, + "quantity": null, + "shipDate": null, + "status": null, + "complete": null, +} satisfies Order + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Order +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterComposite.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterComposite.md new file mode 100644 index 000000000000..3aa13c3f0d4e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterComposite.md @@ -0,0 +1,38 @@ + +# OuterComposite + + +## Properties + +Name | Type +------------ | ------------- +`myNumber` | number +`myString` | string +`myBoolean` | boolean + +## Example + +```typescript +import type { OuterComposite } from '' + +// TODO: Update the object below with actual values +const example = { + "myNumber": null, + "myString": null, + "myBoolean": null, +} satisfies OuterComposite + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterComposite +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnum.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnum.md new file mode 100644 index 000000000000..f0a854cd58d7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnum.md @@ -0,0 +1,32 @@ + +# OuterEnum + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnum } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnum + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnum +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumDefaultValue.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumDefaultValue.md new file mode 100644 index 000000000000..635202415f87 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumDefaultValue.md @@ -0,0 +1,32 @@ + +# OuterEnumDefaultValue + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumDefaultValue } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumDefaultValue + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumDefaultValue +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumInteger.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumInteger.md new file mode 100644 index 000000000000..c5c4b7ee3fef --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumInteger.md @@ -0,0 +1,32 @@ + +# OuterEnumInteger + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumInteger } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumInteger + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumInteger +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 000000000000..1e932e921220 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,32 @@ + +# OuterEnumIntegerDefaultValue + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { OuterEnumIntegerDefaultValue } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies OuterEnumIntegerDefaultValue + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterEnumIntegerDefaultValue +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterObjectWithEnumProperty.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterObjectWithEnumProperty.md new file mode 100644 index 000000000000..468927f018f9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/OuterObjectWithEnumProperty.md @@ -0,0 +1,34 @@ + +# OuterObjectWithEnumProperty + + +## Properties + +Name | Type +------------ | ------------- +`value` | [OuterEnumInteger](OuterEnumInteger.md) + +## Example + +```typescript +import type { OuterObjectWithEnumProperty } from '' + +// TODO: Update the object below with actual values +const example = { + "value": null, +} satisfies OuterObjectWithEnumProperty + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as OuterObjectWithEnumProperty +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ParentWithNullable.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ParentWithNullable.md new file mode 100644 index 000000000000..04eb64fd5306 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ParentWithNullable.md @@ -0,0 +1,36 @@ + +# ParentWithNullable + + +## Properties + +Name | Type +------------ | ------------- +`type` | string +`nullableProperty` | string + +## Example + +```typescript +import type { ParentWithNullable } from '' + +// TODO: Update the object below with actual values +const example = { + "type": null, + "nullableProperty": null, +} satisfies ParentWithNullable + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ParentWithNullable +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Pet.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Pet.md new file mode 100644 index 000000000000..c2719b9b2ac9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Pet.md @@ -0,0 +1,44 @@ + +# Pet + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`category` | [Category](Category.md) +`name` | string +`photoUrls` | Set<string> +`tags` | [Array<Tag>](Tag.md) +`status` | string + +## Example + +```typescript +import type { Pet } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "category": null, + "name": doggie, + "photoUrls": null, + "tags": null, + "status": null, +} satisfies Pet + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Pet +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/PetApi.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/PetApi.md new file mode 100644 index 000000000000..e5da18e8bdb6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/PetApi.md @@ -0,0 +1,687 @@ +# 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 + +> addPet(pet) + +Add a new pet to the store + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { AddPetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + } satisfies AddPetRequest; + + try { + const data = await api.addPet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { DeletePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | Pet id to delete + petId: 789, + // string (optional) + apiKey: apiKey_example, + } satisfies DeletePetRequest; + + try { + const data = await api.deletePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] | +| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByStatus + +> Array<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByStatusRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Array<'available' | 'pending' | 'sold'> | Status values that need to be considered for filter + status: ..., + } satisfies FindPetsByStatusRequest; + + try { + const data = await api.findPetsByStatus(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Enum: available, pending, sold] | + +### Return type + +[**Array<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## findPetsByTags + +> Set<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { FindPetsByTagsRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Set | Tags to filter by + tags: ..., + } satisfies FindPetsByTagsRequest; + + try { + const data = await api.findPetsByTags(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **tags** | `Set` | Tags to filter by | | + +### Return type + +[**Set<Pet>**](Pet.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { GetPetByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to return + petId: 789, + } satisfies GetPetByIdRequest; + + try { + const data = await api.getPetById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] | + +### Return type + +[**Pet**](Pet.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePet + +> updatePet(pet) + +Update an existing pet + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // Pet | Pet object that needs to be added to the store + pet: ..., + } satisfies UpdatePetRequest; + + try { + const data = await api.updatePet(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **pet** | [Pet](Pet.md) | Pet object that needs to be added to the store | | + +### Return type + +`void` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UpdatePetWithFormRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet that needs to be updated + petId: 789, + // string | Updated name of the pet (optional) + name: name_example, + // string | Updated status of the pet (optional) + status: status_example, + } satisfies UpdatePetWithFormRequest; + + try { + const data = await api.updatePetWithForm(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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` (Empty response body) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + // Blob | file to upload (optional) + file: BINARY_DATA_HERE, + } satisfies UploadFileRequest; + + try { + const data = await api.uploadFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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** | `Blob` | file to upload | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + + + +### Example + +```ts +import { + Configuration, + PetApi, +} from ''; +import type { UploadFileWithRequiredFileRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure OAuth2 access token for authorization: petstore_auth implicit + accessToken: "YOUR ACCESS TOKEN", + }); + const api = new PetApi(config); + + const body = { + // number | ID of pet to update + petId: 789, + // Blob | file to upload + requiredFile: BINARY_DATA_HERE, + // string | Additional data to pass to server (optional) + additionalMetadata: additionalMetadata_example, + } satisfies UploadFileWithRequiredFileRequest; + + try { + const data = await api.uploadFileWithRequiredFile(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] | +| **requiredFile** | `Blob` | file to upload | [Defaults to `undefined`] | +| **additionalMetadata** | `string` | Additional data to pass to server | [Optional] [Defaults to `undefined`] | + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth implicit](../README.md#petstore_auth-implicit) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ReadOnlyFirst.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ReadOnlyFirst.md new file mode 100644 index 000000000000..f663955bc85f --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/ReadOnlyFirst.md @@ -0,0 +1,36 @@ + +# ReadOnlyFirst + + +## Properties + +Name | Type +------------ | ------------- +`bar` | string +`baz` | string + +## Example + +```typescript +import type { ReadOnlyFirst } from '' + +// TODO: Update the object below with actual values +const example = { + "bar": null, + "baz": null, +} satisfies ReadOnlyFirst + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as ReadOnlyFirst +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Return.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Return.md new file mode 100644 index 000000000000..c2163d20294d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Return.md @@ -0,0 +1,35 @@ + +# Return + +Model for testing reserved words + +## Properties + +Name | Type +------------ | ------------- +`_return` | number + +## Example + +```typescript +import type { Return } from '' + +// TODO: Update the object below with actual values +const example = { + "_return": null, +} satisfies Return + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Return +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/SingleRefType.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/SingleRefType.md new file mode 100644 index 000000000000..6f61f0b5a6ce --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/SingleRefType.md @@ -0,0 +1,32 @@ + +# SingleRefType + + +## Properties + +Name | Type +------------ | ------------- + +## Example + +```typescript +import type { SingleRefType } from '' + +// TODO: Update the object below with actual values +const example = { +} satisfies SingleRefType + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SingleRefType +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/SpecialModelName.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/SpecialModelName.md new file mode 100644 index 000000000000..5b462196a720 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/SpecialModelName.md @@ -0,0 +1,34 @@ + +# SpecialModelName + + +## Properties + +Name | Type +------------ | ------------- +`$specialPropertyName` | number + +## Example + +```typescript +import type { SpecialModelName } from '' + +// TODO: Update the object below with actual values +const example = { + "$specialPropertyName": null, +} satisfies SpecialModelName + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as SpecialModelName +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/StoreApi.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/StoreApi.md new file mode 100644 index 000000000000..9f6136a7714e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/StoreApi.md @@ -0,0 +1,280 @@ +# 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(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { DeleteOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // string | ID of the order that needs to be deleted + orderId: orderId_example, + } satisfies DeleteOrderRequest; + + try { + const data = await api.deleteOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getInventory + +> { [key: string]: number; } getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetInventoryRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const config = new Configuration({ + // To configure API key authorization: api_key + apiKey: "YOUR API KEY", + }); + const api = new StoreApi(config); + + try { + const data = await api.getInventory(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { GetOrderByIdRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // number | ID of pet that needs to be fetched + orderId: 789, + } satisfies GetOrderByIdRequest; + + try { + const data = await api.getOrderById(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **orderId** | `number` | ID of pet that needs to be fetched | [Defaults to `undefined`] | + +### Return type + +[**Order**](Order.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## placeOrder + +> Order placeOrder(order) + +Place an order for a pet + + + +### Example + +```ts +import { + Configuration, + StoreApi, +} from ''; +import type { PlaceOrderRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new StoreApi(); + + const body = { + // Order | order placed for purchasing the pet + order: ..., + } satisfies PlaceOrderRequest; + + try { + const data = await api.placeOrder(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **order** | [Order](Order.md) | order placed for purchasing the pet | | + +### Return type + +[**Order**](Order.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Tag.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Tag.md new file mode 100644 index 000000000000..94b8b8810ed7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/Tag.md @@ -0,0 +1,36 @@ + +# Tag + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`name` | string + +## Example + +```typescript +import type { Tag } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "name": null, +} satisfies Tag + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as Tag +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/TestInlineFreeformAdditionalPropertiesRequest.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/TestInlineFreeformAdditionalPropertiesRequest.md new file mode 100644 index 000000000000..0f434686fe93 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/TestInlineFreeformAdditionalPropertiesRequest.md @@ -0,0 +1,34 @@ + +# TestInlineFreeformAdditionalPropertiesRequest + + +## Properties + +Name | Type +------------ | ------------- +`someProperty` | string + +## Example + +```typescript +import type { TestInlineFreeformAdditionalPropertiesRequest } from '' + +// TODO: Update the object below with actual values +const example = { + "someProperty": null, +} satisfies TestInlineFreeformAdditionalPropertiesRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as TestInlineFreeformAdditionalPropertiesRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/User.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/User.md new file mode 100644 index 000000000000..198cd8da459d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/User.md @@ -0,0 +1,48 @@ + +# User + + +## Properties + +Name | Type +------------ | ------------- +`id` | number +`username` | string +`firstName` | string +`lastName` | string +`email` | string +`password` | string +`phone` | string +`userStatus` | number + +## Example + +```typescript +import type { User } from '' + +// TODO: Update the object below with actual values +const example = { + "id": null, + "username": null, + "firstName": null, + "lastName": null, + "email": null, + "password": null, + "phone": null, + "userStatus": null, +} satisfies User + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as User +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/UserApi.md b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/UserApi.md new file mode 100644 index 000000000000..f537a517e225 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/docs/UserApi.md @@ -0,0 +1,555 @@ +# 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) + +Create user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // User | Created user object + user: ..., + } satisfies CreateUserRequest; + + try { + const data = await api.createUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **user** | [User](User.md) | 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(user) + +Creates list of users with given input array + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithArrayInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + user: ..., + } satisfies CreateUsersWithArrayInputRequest; + + try { + const data = await api.createUsersWithArrayInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createUsersWithListInput + +> createUsersWithListInput(user) + +Creates list of users with given input array + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { CreateUsersWithListInputRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // Array | List of user object + user: ..., + } satisfies CreateUsersWithListInputRequest; + + try { + const data = await api.createUsersWithListInput(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { DeleteUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be deleted + username: username_example, + } satisfies DeleteUserRequest; + + try { + const data = await api.deleteUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { GetUserByNameRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The name that needs to be fetched. Use user1 for testing. + username: username_example, + } satisfies GetUserByNameRequest; + + try { + const data = await api.getUserByName(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | The name that needs to be fetched. Use user1 for testing. | [Defaults to `undefined`] | + +### Return type + +[**User**](User.md) + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## loginUser + +> string loginUser(username, password) + +Logs user into the system + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LoginUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | The user name for login + username: username_example, + // string | The password for login in clear text + password: password_example, + } satisfies LoginUserRequest; + + try { + const data = await api.loginUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + + + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { LogoutUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + try { + const data = await api.logoutUser(); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### 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#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateUser + +> updateUser(username, user) + +Updated user + +This can only be done by the logged in user. + +### Example + +```ts +import { + Configuration, + UserApi, +} from ''; +import type { UpdateUserRequest } from ''; + +async function example() { + console.log("🚀 Testing SDK..."); + const api = new UserApi(); + + const body = { + // string | name that need to be deleted + username: username_example, + // User | Updated user object + user: ..., + } satisfies UpdateUserRequest; + + try { + const data = await api.updateUser(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **username** | `string` | name that need to be deleted | [Defaults to `undefined`] | +| **user** | [User](User.md) | Updated 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 | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/index.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/index.ts new file mode 100644 index 000000000000..bebe8bbbe206 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/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/petstore/typescript-fetch/builds/kebab-case/models/additional-properties-class.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/additional-properties-class.ts new file mode 100644 index 000000000000..d470576ef7d3 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/additional-properties-class.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface AdditionalPropertiesClass + */ +export interface AdditionalPropertiesClass { + /** + * + * @type {{ [key: string]: string; }} + * @memberof AdditionalPropertiesClass + */ + mapProperty?: { [key: string]: string; }; + /** + * + * @type {{ [key: string]: { [key: string]: string; }; }} + * @memberof AdditionalPropertiesClass + */ + mapOfMapProperty?: { [key: string]: { [key: string]: string; }; }; +} + +/** + * Check if a given object implements the AdditionalPropertiesClass interface. + */ +export function instanceOfAdditionalPropertiesClass(value: object): value is AdditionalPropertiesClass { + return true; +} + +export function AdditionalPropertiesClassFromJSON(json: any): AdditionalPropertiesClass { + return AdditionalPropertiesClassFromJSONTyped(json, false); +} + +export function AdditionalPropertiesClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdditionalPropertiesClass { + if (json == null) { + return json; + } + return { + + 'mapProperty': json['map_property'] == null ? undefined : json['map_property'], + 'mapOfMapProperty': json['map_of_map_property'] == null ? undefined : json['map_of_map_property'], + }; +} + +export function AdditionalPropertiesClassToJSON(json: any): AdditionalPropertiesClass { + return AdditionalPropertiesClassToJSONTyped(json, false); +} + +export function AdditionalPropertiesClassToJSONTyped(value?: AdditionalPropertiesClass | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'map_property': value['mapProperty'], + 'map_of_map_property': value['mapOfMapProperty'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/all-of-with-single-ref.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/all-of-with-single-ref.ts new file mode 100644 index 000000000000..db9c615f1963 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/all-of-with-single-ref.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { SingleRefType } from './single-ref-type'; +import { + SingleRefTypeFromJSON, + SingleRefTypeFromJSONTyped, + SingleRefTypeToJSON, + SingleRefTypeToJSONTyped, +} from './single-ref-type'; + +/** + * + * @export + * @interface AllOfWithSingleRef + */ +export interface AllOfWithSingleRef { + /** + * + * @type {string} + * @memberof AllOfWithSingleRef + */ + username?: string; + /** + * + * @type {SingleRefType} + * @memberof AllOfWithSingleRef + */ + singleRefType?: SingleRefType; +} + + + +/** + * Check if a given object implements the AllOfWithSingleRef interface. + */ +export function instanceOfAllOfWithSingleRef(value: object): value is AllOfWithSingleRef { + return true; +} + +export function AllOfWithSingleRefFromJSON(json: any): AllOfWithSingleRef { + return AllOfWithSingleRefFromJSONTyped(json, false); +} + +export function AllOfWithSingleRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): AllOfWithSingleRef { + if (json == null) { + return json; + } + return { + + 'username': json['username'] == null ? undefined : json['username'], + 'singleRefType': json['SingleRefType'] == null ? undefined : SingleRefTypeFromJSON(json['SingleRefType']), + }; +} + +export function AllOfWithSingleRefToJSON(json: any): AllOfWithSingleRef { + return AllOfWithSingleRefToJSONTyped(json, false); +} + +export function AllOfWithSingleRefToJSONTyped(value?: AllOfWithSingleRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'username': value['username'], + 'SingleRefType': SingleRefTypeToJSON(value['singleRefType']), + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/animal.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/animal.ts new file mode 100644 index 000000000000..93f905537d4a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/animal.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 Cat, CatFromJSONTyped, CatToJSON, CatToJSONTyped } from './Cat'; +import { type Dog, DogFromJSONTyped, DogToJSON, DogToJSONTyped } from './Dog'; +/** + * + * @export + * @interface Animal + */ +export interface Animal { + /** + * + * @type {string} + * @memberof Animal + */ + className: string; + /** + * + * @type {string} + * @memberof Animal + */ + color?: string; +} + +/** + * Check if a given object implements the Animal interface. + */ +export function instanceOfAnimal(value: object): value is Animal { + if (!('className' in value) || value['className'] === undefined) return false; + return true; +} + +export function AnimalFromJSON(json: any): Animal { + return AnimalFromJSONTyped(json, false); +} + +export function AnimalFromJSONTyped(json: any, ignoreDiscriminator: boolean): Animal { + if (json == null) { + return json; + } + if (!ignoreDiscriminator) { + if (json['className'] === 'CAT') { + return CatFromJSONTyped(json, ignoreDiscriminator); + } + if (json['className'] === 'DOG') { + return DogFromJSONTyped(json, ignoreDiscriminator); + } + + } + return { + + 'className': json['className'], + 'color': json['color'] == null ? undefined : json['color'], + }; +} + +export function AnimalToJSON(json: any): Animal { + return AnimalToJSONTyped(json, false); +} + +export function AnimalToJSONTyped(value?: Animal | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + if (!ignoreDiscriminator) { + switch (value['className']) { + case 'CAT': + return CatToJSONTyped(value as Cat, ignoreDiscriminator); + case 'DOG': + return DogToJSONTyped(value as Dog, ignoreDiscriminator); + default: + return value; + } + } + + return { + + 'className': value['className'], + 'color': value['color'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-of-array-of-number-only.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-of-array-of-number-only.ts new file mode 100644 index 000000000000..3792b9134b4a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-of-array-of-number-only.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface ArrayOfArrayOfNumberOnly + */ +export interface ArrayOfArrayOfNumberOnly { + /** + * + * @type {Array>} + * @memberof ArrayOfArrayOfNumberOnly + */ + arrayArrayNumber?: Array>; +} + +/** + * Check if a given object implements the ArrayOfArrayOfNumberOnly interface. + */ +export function instanceOfArrayOfArrayOfNumberOnly(value: object): value is ArrayOfArrayOfNumberOnly { + return true; +} + +export function ArrayOfArrayOfNumberOnlyFromJSON(json: any): ArrayOfArrayOfNumberOnly { + return ArrayOfArrayOfNumberOnlyFromJSONTyped(json, false); +} + +export function ArrayOfArrayOfNumberOnlyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArrayOfArrayOfNumberOnly { + if (json == null) { + return json; + } + return { + + 'arrayArrayNumber': json['ArrayArrayNumber'] == null ? undefined : json['ArrayArrayNumber'], + }; +} + +export function ArrayOfArrayOfNumberOnlyToJSON(json: any): ArrayOfArrayOfNumberOnly { + return ArrayOfArrayOfNumberOnlyToJSONTyped(json, false); +} + +export function ArrayOfArrayOfNumberOnlyToJSONTyped(value?: ArrayOfArrayOfNumberOnly | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'ArrayArrayNumber': value['arrayArrayNumber'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-of-number-only.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-of-number-only.ts new file mode 100644 index 000000000000..40fbb3c6326d --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-of-number-only.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface ArrayOfNumberOnly + */ +export interface ArrayOfNumberOnly { + /** + * + * @type {Array} + * @memberof ArrayOfNumberOnly + */ + arrayNumber?: Array; +} + +/** + * Check if a given object implements the ArrayOfNumberOnly interface. + */ +export function instanceOfArrayOfNumberOnly(value: object): value is ArrayOfNumberOnly { + return true; +} + +export function ArrayOfNumberOnlyFromJSON(json: any): ArrayOfNumberOnly { + return ArrayOfNumberOnlyFromJSONTyped(json, false); +} + +export function ArrayOfNumberOnlyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArrayOfNumberOnly { + if (json == null) { + return json; + } + return { + + 'arrayNumber': json['ArrayNumber'] == null ? undefined : json['ArrayNumber'], + }; +} + +export function ArrayOfNumberOnlyToJSON(json: any): ArrayOfNumberOnly { + return ArrayOfNumberOnlyToJSONTyped(json, false); +} + +export function ArrayOfNumberOnlyToJSONTyped(value?: ArrayOfNumberOnly | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'ArrayNumber': value['arrayNumber'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-test.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-test.ts new file mode 100644 index 000000000000..aa20b52da573 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/array-test.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { ReadOnlyFirst } from './read-only-first'; +import { + ReadOnlyFirstFromJSON, + ReadOnlyFirstFromJSONTyped, + ReadOnlyFirstToJSON, + ReadOnlyFirstToJSONTyped, +} from './read-only-first'; + +/** + * + * @export + * @interface ArrayTest + */ +export interface ArrayTest { + /** + * + * @type {Array} + * @memberof ArrayTest + */ + arrayOfString?: Array; + /** + * + * @type {Array>} + * @memberof ArrayTest + */ + arrayArrayOfInteger?: Array>; + /** + * + * @type {Array>} + * @memberof ArrayTest + */ + arrayArrayOfModel?: Array>; +} + +/** + * Check if a given object implements the ArrayTest interface. + */ +export function instanceOfArrayTest(value: object): value is ArrayTest { + return true; +} + +export function ArrayTestFromJSON(json: any): ArrayTest { + return ArrayTestFromJSONTyped(json, false); +} + +export function ArrayTestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArrayTest { + if (json == null) { + return json; + } + return { + + 'arrayOfString': json['array_of_string'] == null ? undefined : json['array_of_string'], + 'arrayArrayOfInteger': json['array_array_of_integer'] == null ? undefined : json['array_array_of_integer'], + 'arrayArrayOfModel': json['array_array_of_model'] == null ? undefined : json['array_array_of_model'], + }; +} + +export function ArrayTestToJSON(json: any): ArrayTest { + return ArrayTestToJSONTyped(json, false); +} + +export function ArrayTestToJSONTyped(value?: ArrayTest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'array_of_string': value['arrayOfString'], + 'array_array_of_integer': value['arrayArrayOfInteger'], + 'array_array_of_model': value['arrayArrayOfModel'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/capitalization.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/capitalization.ts new file mode 100644 index 000000000000..9c6a2be5afb6 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/capitalization.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface Capitalization + */ +export interface Capitalization { + /** + * + * @type {string} + * @memberof Capitalization + */ + smallCamel?: string; + /** + * + * @type {string} + * @memberof Capitalization + */ + capitalCamel?: string; + /** + * + * @type {string} + * @memberof Capitalization + */ + smallSnake?: string; + /** + * + * @type {string} + * @memberof Capitalization + */ + capitalSnake?: string; + /** + * + * @type {string} + * @memberof Capitalization + */ + sCAETHFlowPoints?: string; + /** + * Name of the pet + * + * @type {string} + * @memberof Capitalization + */ + aTTNAME?: string; +} + +/** + * Check if a given object implements the Capitalization interface. + */ +export function instanceOfCapitalization(value: object): value is Capitalization { + return true; +} + +export function CapitalizationFromJSON(json: any): Capitalization { + return CapitalizationFromJSONTyped(json, false); +} + +export function CapitalizationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Capitalization { + if (json == null) { + return json; + } + return { + + 'smallCamel': json['smallCamel'] == null ? undefined : json['smallCamel'], + 'capitalCamel': json['CapitalCamel'] == null ? undefined : json['CapitalCamel'], + 'smallSnake': json['small_Snake'] == null ? undefined : json['small_Snake'], + 'capitalSnake': json['Capital_Snake'] == null ? undefined : json['Capital_Snake'], + 'sCAETHFlowPoints': json['SCA_ETH_Flow_Points'] == null ? undefined : json['SCA_ETH_Flow_Points'], + 'aTTNAME': json['ATT_NAME'] == null ? undefined : json['ATT_NAME'], + }; +} + +export function CapitalizationToJSON(json: any): Capitalization { + return CapitalizationToJSONTyped(json, false); +} + +export function CapitalizationToJSONTyped(value?: Capitalization | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'smallCamel': value['smallCamel'], + 'CapitalCamel': value['capitalCamel'], + 'small_Snake': value['smallSnake'], + 'Capital_Snake': value['capitalSnake'], + 'SCA_ETH_Flow_Points': value['sCAETHFlowPoints'], + 'ATT_NAME': value['aTTNAME'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/cat.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/cat.ts new file mode 100644 index 000000000000..6a2e72f95724 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/cat.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { Animal } from './animal'; +import { + AnimalFromJSON, + AnimalFromJSONTyped, + AnimalToJSON, + AnimalToJSONTyped, +} from './animal'; + +/** + * + * @export + * @interface Cat + */ +export interface Cat extends Animal { + /** + * + * @type {boolean} + * @memberof Cat + */ + declawed?: boolean; +} + +/** + * Check if a given object implements the Cat interface. + */ +export function instanceOfCat(value: object): value is Cat { + return true; +} + +export function CatFromJSON(json: any): Cat { + return CatFromJSONTyped(json, false); +} + +export function CatFromJSONTyped(json: any, ignoreDiscriminator: boolean): Cat { + if (json == null) { + return json; + } + return { + ...AnimalFromJSONTyped(json, true), + 'declawed': json['declawed'] == null ? undefined : json['declawed'], + }; +} + +export function CatToJSON(json: any): Cat { + return CatToJSONTyped(json, false); +} + +export function CatToJSONTyped(value?: Cat | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + ...AnimalToJSONTyped(value, true), + 'declawed': value['declawed'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/category.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/category.ts new file mode 100644 index 000000000000..e4047d919b2b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/category.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + id?: number; + /** + * + * @type {string} + * @memberof Category + */ + name: string; +} + +/** + * Check if a given object implements the Category interface. + */ +export function instanceOfCategory(value: object): value is Category { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function CategoryFromJSON(json: any): Category { + return CategoryFromJSONTyped(json, false); +} + +export function CategoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Category { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'], + }; +} + +export function CategoryToJSON(json: any): Category { + return CategoryToJSONTyped(json, false); +} + +export function CategoryToJSONTyped(value?: Category | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/child-with-nullable.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/child-with-nullable.ts new file mode 100644 index 000000000000..25a490b0a0af --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/child-with-nullable.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { ParentWithNullable } from './parent-with-nullable'; +import { + ParentWithNullableFromJSON, + ParentWithNullableFromJSONTyped, + ParentWithNullableToJSON, + ParentWithNullableToJSONTyped, +} from './parent-with-nullable'; + +/** + * + * @export + * @interface ChildWithNullable + */ +export interface ChildWithNullable extends ParentWithNullable { + /** + * + * @type {string} + * @memberof ChildWithNullable + */ + otherProperty?: string; +} + + + +/** + * Check if a given object implements the ChildWithNullable interface. + */ +export function instanceOfChildWithNullable(value: object): value is ChildWithNullable { + return true; +} + +export function ChildWithNullableFromJSON(json: any): ChildWithNullable { + return ChildWithNullableFromJSONTyped(json, false); +} + +export function ChildWithNullableFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChildWithNullable { + if (json == null) { + return json; + } + return { + ...ParentWithNullableFromJSONTyped(json, true), + 'otherProperty': json['otherProperty'] == null ? undefined : json['otherProperty'], + }; +} + +export function ChildWithNullableToJSON(json: any): ChildWithNullable { + return ChildWithNullableToJSONTyped(json, false); +} + +export function ChildWithNullableToJSONTyped(value?: ChildWithNullable | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + ...ParentWithNullableToJSONTyped(value, true), + 'otherProperty': value['otherProperty'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/class-model.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/class-model.ts new file mode 100644 index 000000000000..cba5bbc353cf --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/class-model.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * Model for testing model with "_class" property + * @export + * @interface ClassModel + */ +export interface ClassModel { + /** + * + * @type {string} + * @memberof ClassModel + */ + _class?: string; +} + +/** + * Check if a given object implements the ClassModel interface. + */ +export function instanceOfClassModel(value: object): value is ClassModel { + return true; +} + +export function ClassModelFromJSON(json: any): ClassModel { + return ClassModelFromJSONTyped(json, false); +} + +export function ClassModelFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClassModel { + if (json == null) { + return json; + } + return { + + '_class': json['_class'] == null ? undefined : json['_class'], + }; +} + +export function ClassModelToJSON(json: any): ClassModel { + return ClassModelToJSONTyped(json, false); +} + +export function ClassModelToJSONTyped(value?: ClassModel | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '_class': value['_class'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/client.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/client.ts new file mode 100644 index 000000000000..b9509a4421f9 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/client.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface Client + */ +export interface Client { + /** + * + * @type {string} + * @memberof Client + */ + client?: string; +} + +/** + * Check if a given object implements the Client interface. + */ +export function instanceOfClient(value: object): value is Client { + return true; +} + +export function ClientFromJSON(json: any): Client { + return ClientFromJSONTyped(json, false); +} + +export function ClientFromJSONTyped(json: any, ignoreDiscriminator: boolean): Client { + if (json == null) { + return json; + } + return { + + 'client': json['client'] == null ? undefined : json['client'], + }; +} + +export function ClientToJSON(json: any): Client { + return ClientToJSONTyped(json, false); +} + +export function ClientToJSONTyped(value?: Client | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'client': value['client'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/deprecated-object.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/deprecated-object.ts new file mode 100644 index 000000000000..2b22f28ddfe7 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/deprecated-object.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface DeprecatedObject + */ +export interface DeprecatedObject { + /** + * + * @type {string} + * @memberof DeprecatedObject + */ + name?: string; +} + +/** + * Check if a given object implements the DeprecatedObject interface. + */ +export function instanceOfDeprecatedObject(value: object): value is DeprecatedObject { + return true; +} + +export function DeprecatedObjectFromJSON(json: any): DeprecatedObject { + return DeprecatedObjectFromJSONTyped(json, false); +} + +export function DeprecatedObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeprecatedObject { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + }; +} + +export function DeprecatedObjectToJSON(json: any): DeprecatedObject { + return DeprecatedObjectToJSONTyped(json, false); +} + +export function DeprecatedObjectToJSONTyped(value?: DeprecatedObject | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/dog.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/dog.ts new file mode 100644 index 000000000000..6a426752af39 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/dog.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { Animal } from './animal'; +import { + AnimalFromJSON, + AnimalFromJSONTyped, + AnimalToJSON, + AnimalToJSONTyped, +} from './animal'; + +/** + * + * @export + * @interface Dog + */ +export interface Dog extends Animal { + /** + * + * @type {string} + * @memberof Dog + */ + breed?: string; +} + +/** + * Check if a given object implements the Dog interface. + */ +export function instanceOfDog(value: object): value is Dog { + return true; +} + +export function DogFromJSON(json: any): Dog { + return DogFromJSONTyped(json, false); +} + +export function DogFromJSONTyped(json: any, ignoreDiscriminator: boolean): Dog { + if (json == null) { + return json; + } + return { + ...AnimalFromJSONTyped(json, true), + 'breed': json['breed'] == null ? undefined : json['breed'], + }; +} + +export function DogToJSON(json: any): Dog { + return DogToJSONTyped(json, false); +} + +export function DogToJSONTyped(value?: Dog | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + ...AnimalToJSONTyped(value, true), + 'breed': value['breed'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-arrays.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-arrays.ts new file mode 100644 index 000000000000..b56bf8dc1baa --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-arrays.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface EnumArrays + */ +export interface EnumArrays { + /** + * + * @type {EnumArraysJustSymbolEnum} + * @memberof EnumArrays + */ + justSymbol?: EnumArraysJustSymbolEnum; + /** + * + * @type {Array} + * @memberof EnumArrays + */ + arrayEnum?: Array; +} + + +/** + * @export + */ +export const EnumArraysJustSymbolEnum = { + GreaterThanOrEqualTo: '>=', + Dollar: '$' +} as const; +export type EnumArraysJustSymbolEnum = typeof EnumArraysJustSymbolEnum[keyof typeof EnumArraysJustSymbolEnum]; + +/** + * @export + */ +export const EnumArraysArrayEnumEnum = { + Fish: 'fish', + Crab: 'crab' +} as const; +export type EnumArraysArrayEnumEnum = typeof EnumArraysArrayEnumEnum[keyof typeof EnumArraysArrayEnumEnum]; + + +/** + * Check if a given object implements the EnumArrays interface. + */ +export function instanceOfEnumArrays(value: object): value is EnumArrays { + return true; +} + +export function EnumArraysFromJSON(json: any): EnumArrays { + return EnumArraysFromJSONTyped(json, false); +} + +export function EnumArraysFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnumArrays { + if (json == null) { + return json; + } + return { + + 'justSymbol': json['just_symbol'] == null ? undefined : json['just_symbol'], + 'arrayEnum': json['array_enum'] == null ? undefined : json['array_enum'], + }; +} + +export function EnumArraysToJSON(json: any): EnumArrays { + return EnumArraysToJSONTyped(json, false); +} + +export function EnumArraysToJSONTyped(value?: EnumArrays | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'just_symbol': value['justSymbol'], + 'array_enum': value['arrayEnum'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-class.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-class.ts new file mode 100644 index 000000000000..6878b8591431 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-class.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 EnumClass = { + Abc: '_abc', + Efg: '-efg', + Xyz: '(xyz)' +} as const; +export type EnumClass = typeof EnumClass[keyof typeof EnumClass]; + + +export function instanceOfEnumClass(value: any): boolean { + for (const key in EnumClass) { + if (Object.prototype.hasOwnProperty.call(EnumClass, key)) { + if (EnumClass[key as keyof typeof EnumClass] === value) { + return true; + } + } + } + return false; +} + +export function EnumClassFromJSON(json: any): EnumClass { + return EnumClassFromJSONTyped(json, false); +} + +export function EnumClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnumClass { + return json as EnumClass; +} + +export function EnumClassToJSON(value?: EnumClass | null): any { + return value as any; +} + +export function EnumClassToJSONTyped(value: any, ignoreDiscriminator: boolean): EnumClass { + return value as EnumClass; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-test.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-test.ts new file mode 100644 index 000000000000..d23b075ea7d2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/enum-test.ts @@ -0,0 +1,191 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { OuterEnum } from './outer-enum'; +import { + OuterEnumFromJSON, + OuterEnumFromJSONTyped, + OuterEnumToJSON, + OuterEnumToJSONTyped, +} from './outer-enum'; +import type { OuterEnumIntegerDefaultValue } from './outer-enum-integer-default-value'; +import { + OuterEnumIntegerDefaultValueFromJSON, + OuterEnumIntegerDefaultValueFromJSONTyped, + OuterEnumIntegerDefaultValueToJSON, + OuterEnumIntegerDefaultValueToJSONTyped, +} from './outer-enum-integer-default-value'; +import type { OuterEnumInteger } from './outer-enum-integer'; +import { + OuterEnumIntegerFromJSON, + OuterEnumIntegerFromJSONTyped, + OuterEnumIntegerToJSON, + OuterEnumIntegerToJSONTyped, +} from './outer-enum-integer'; +import type { OuterEnumDefaultValue } from './outer-enum-default-value'; +import { + OuterEnumDefaultValueFromJSON, + OuterEnumDefaultValueFromJSONTyped, + OuterEnumDefaultValueToJSON, + OuterEnumDefaultValueToJSONTyped, +} from './outer-enum-default-value'; + +/** + * + * @export + * @interface EnumTest + */ +export interface EnumTest { + /** + * + * @type {EnumTestEnumStringEnum} + * @memberof EnumTest + */ + enumString?: EnumTestEnumStringEnum; + /** + * + * @type {EnumTestEnumStringRequiredEnum} + * @memberof EnumTest + */ + enumStringRequired: EnumTestEnumStringRequiredEnum; + /** + * + * @type {EnumTestEnumIntegerEnum} + * @memberof EnumTest + */ + enumInteger?: EnumTestEnumIntegerEnum; + /** + * + * @type {EnumTestEnumNumberEnum} + * @memberof EnumTest + */ + enumNumber?: EnumTestEnumNumberEnum; + /** + * + * @type {OuterEnum} + * @memberof EnumTest + */ + outerEnum?: OuterEnum | null; + /** + * + * @type {OuterEnumInteger} + * @memberof EnumTest + */ + outerEnumInteger?: OuterEnumInteger; + /** + * + * @type {OuterEnumDefaultValue} + * @memberof EnumTest + */ + outerEnumDefaultValue?: OuterEnumDefaultValue; + /** + * + * @type {OuterEnumIntegerDefaultValue} + * @memberof EnumTest + */ + outerEnumIntegerDefaultValue?: OuterEnumIntegerDefaultValue; +} + + +/** + * @export + */ +export const EnumTestEnumStringEnum = { + Upper: 'UPPER', + Lower: 'lower', + Empty: '' +} as const; +export type EnumTestEnumStringEnum = typeof EnumTestEnumStringEnum[keyof typeof EnumTestEnumStringEnum]; + +/** + * @export + */ +export const EnumTestEnumStringRequiredEnum = { + Upper: 'UPPER', + Lower: 'lower', + Empty: '' +} as const; +export type EnumTestEnumStringRequiredEnum = typeof EnumTestEnumStringRequiredEnum[keyof typeof EnumTestEnumStringRequiredEnum]; + +/** + * @export + */ +export const EnumTestEnumIntegerEnum = { + NUMBER_1: 1, + NUMBER_MINUS_1: -1 +} as const; +export type EnumTestEnumIntegerEnum = typeof EnumTestEnumIntegerEnum[keyof typeof EnumTestEnumIntegerEnum]; + +/** + * @export + */ +export const EnumTestEnumNumberEnum = { + NUMBER_1_DOT_1: 1.1, + NUMBER_MINUS_1_DOT_2: -1.2 +} as const; +export type EnumTestEnumNumberEnum = typeof EnumTestEnumNumberEnum[keyof typeof EnumTestEnumNumberEnum]; + + +/** + * Check if a given object implements the EnumTest interface. + */ +export function instanceOfEnumTest(value: object): value is EnumTest { + if ((!('enumStringRequired' in value) && !('enum_string_required' in value)) || (value['enumStringRequired'] === undefined && value['enum_string_required'] === undefined)) return false; + return true; +} + +export function EnumTestFromJSON(json: any): EnumTest { + return EnumTestFromJSONTyped(json, false); +} + +export function EnumTestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnumTest { + if (json == null) { + return json; + } + return { + + 'enumString': json['enum_string'] == null ? undefined : json['enum_string'], + 'enumStringRequired': json['enum_string_required'], + 'enumInteger': json['enum_integer'] == null ? undefined : json['enum_integer'], + 'enumNumber': json['enum_number'] == null ? undefined : json['enum_number'], + 'outerEnum': json['outerEnum'] == null ? undefined : OuterEnumFromJSON(json['outerEnum']), + 'outerEnumInteger': json['outerEnumInteger'] == null ? undefined : OuterEnumIntegerFromJSON(json['outerEnumInteger']), + 'outerEnumDefaultValue': json['outerEnumDefaultValue'] == null ? undefined : OuterEnumDefaultValueFromJSON(json['outerEnumDefaultValue']), + 'outerEnumIntegerDefaultValue': json['outerEnumIntegerDefaultValue'] == null ? undefined : OuterEnumIntegerDefaultValueFromJSON(json['outerEnumIntegerDefaultValue']), + }; +} + +export function EnumTestToJSON(json: any): EnumTest { + return EnumTestToJSONTyped(json, false); +} + +export function EnumTestToJSONTyped(value?: EnumTest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'enum_string': value['enumString'], + 'enum_string_required': value['enumStringRequired'], + 'enum_integer': value['enumInteger'], + 'enum_number': value['enumNumber'], + 'outerEnum': OuterEnumToJSON(value['outerEnum']), + 'outerEnumInteger': OuterEnumIntegerToJSON(value['outerEnumInteger']), + 'outerEnumDefaultValue': OuterEnumDefaultValueToJSON(value['outerEnumDefaultValue']), + 'outerEnumIntegerDefaultValue': OuterEnumIntegerDefaultValueToJSON(value['outerEnumIntegerDefaultValue']), + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/fake-big-decimal-map200-response.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/fake-big-decimal-map200-response.ts new file mode 100644 index 000000000000..54458419a514 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/fake-big-decimal-map200-response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface FakeBigDecimalMap200Response + */ +export interface FakeBigDecimalMap200Response { + /** + * + * @type {number} + * @memberof FakeBigDecimalMap200Response + */ + someId?: number; + /** + * + * @type {{ [key: string]: number; }} + * @memberof FakeBigDecimalMap200Response + */ + someMap?: { [key: string]: number; }; +} + +/** + * Check if a given object implements the FakeBigDecimalMap200Response interface. + */ +export function instanceOfFakeBigDecimalMap200Response(value: object): value is FakeBigDecimalMap200Response { + return true; +} + +export function FakeBigDecimalMap200ResponseFromJSON(json: any): FakeBigDecimalMap200Response { + return FakeBigDecimalMap200ResponseFromJSONTyped(json, false); +} + +export function FakeBigDecimalMap200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FakeBigDecimalMap200Response { + if (json == null) { + return json; + } + return { + + 'someId': json['someId'] == null ? undefined : json['someId'], + 'someMap': json['someMap'] == null ? undefined : json['someMap'], + }; +} + +export function FakeBigDecimalMap200ResponseToJSON(json: any): FakeBigDecimalMap200Response { + return FakeBigDecimalMap200ResponseToJSONTyped(json, false); +} + +export function FakeBigDecimalMap200ResponseToJSONTyped(value?: FakeBigDecimalMap200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'someId': value['someId'], + 'someMap': value['someMap'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/file-schema-test-class.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/file-schema-test-class.ts new file mode 100644 index 000000000000..87a77f497fbc --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/file-schema-test-class.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface FileSchemaTestClass + */ +export interface FileSchemaTestClass { + /** + * + * @type {any} + * @memberof FileSchemaTestClass + */ + file?: any; + /** + * + * @type {Array} + * @memberof FileSchemaTestClass + */ + files?: Array; +} + +/** + * Check if a given object implements the FileSchemaTestClass interface. + */ +export function instanceOfFileSchemaTestClass(value: object): value is FileSchemaTestClass { + return true; +} + +export function FileSchemaTestClassFromJSON(json: any): FileSchemaTestClass { + return FileSchemaTestClassFromJSONTyped(json, false); +} + +export function FileSchemaTestClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileSchemaTestClass { + if (json == null) { + return json; + } + return { + + 'file': json['file'] == null ? undefined : json['file'], + 'files': json['files'] == null ? undefined : json['files'], + }; +} + +export function FileSchemaTestClassToJSON(json: any): FileSchemaTestClass { + return FileSchemaTestClassToJSONTyped(json, false); +} + +export function FileSchemaTestClassToJSONTyped(value?: FileSchemaTestClass | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'file': value['file'], + 'files': value['files'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/foo-get-default-response.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/foo-get-default-response.ts new file mode 100644 index 000000000000..27d372a46be0 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/foo-get-default-response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { Foo } from './foo'; +import { + FooFromJSON, + FooFromJSONTyped, + FooToJSON, + FooToJSONTyped, +} from './foo'; + +/** + * + * @export + * @interface FooGetDefaultResponse + */ +export interface FooGetDefaultResponse { + /** + * + * @type {Foo} + * @memberof FooGetDefaultResponse + */ + string?: Foo; +} + +/** + * Check if a given object implements the FooGetDefaultResponse interface. + */ +export function instanceOfFooGetDefaultResponse(value: object): value is FooGetDefaultResponse { + return true; +} + +export function FooGetDefaultResponseFromJSON(json: any): FooGetDefaultResponse { + return FooGetDefaultResponseFromJSONTyped(json, false); +} + +export function FooGetDefaultResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FooGetDefaultResponse { + if (json == null) { + return json; + } + return { + + 'string': json['string'] == null ? undefined : FooFromJSON(json['string']), + }; +} + +export function FooGetDefaultResponseToJSON(json: any): FooGetDefaultResponse { + return FooGetDefaultResponseToJSONTyped(json, false); +} + +export function FooGetDefaultResponseToJSONTyped(value?: FooGetDefaultResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'string': FooToJSON(value['string']), + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/foo.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/foo.ts new file mode 100644 index 000000000000..ca208c88e2f8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/foo.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface Foo + */ +export interface Foo { + /** + * + * @type {string} + * @memberof Foo + */ + bar?: string; +} + +/** + * Check if a given object implements the Foo interface. + */ +export function instanceOfFoo(value: object): value is Foo { + return true; +} + +export function FooFromJSON(json: any): Foo { + return FooFromJSONTyped(json, false); +} + +export function FooFromJSONTyped(json: any, ignoreDiscriminator: boolean): Foo { + if (json == null) { + return json; + } + return { + + 'bar': json['bar'] == null ? undefined : json['bar'], + }; +} + +export function FooToJSON(json: any): Foo { + return FooToJSONTyped(json, false); +} + +export function FooToJSONTyped(value?: Foo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'bar': value['bar'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/format-test.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/format-test.ts new file mode 100644 index 000000000000..822bb60636fb --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/format-test.ts @@ -0,0 +1,189 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface FormatTest + */ +export interface FormatTest { + /** + * + * @type {number} + * @memberof FormatTest + */ + integer?: number; + /** + * + * @type {number} + * @memberof FormatTest + */ + int32?: number; + /** + * + * @type {number} + * @memberof FormatTest + */ + int64?: number; + /** + * + * @type {number} + * @memberof FormatTest + */ + number: number; + /** + * + * @type {number} + * @memberof FormatTest + */ + _float?: number; + /** + * + * @type {number} + * @memberof FormatTest + */ + _double?: number; + /** + * + * @type {string} + * @memberof FormatTest + */ + decimal?: string; + /** + * + * @type {string} + * @memberof FormatTest + */ + string?: string; + /** + * + * @type {string} + * @memberof FormatTest + */ + _byte: string; + /** + * + * @type {Blob} + * @memberof FormatTest + */ + binary?: Blob; + /** + * + * @type {Date} + * @memberof FormatTest + */ + date: Date; + /** + * + * @type {Date} + * @memberof FormatTest + */ + dateTime?: Date; + /** + * + * @type {string} + * @memberof FormatTest + */ + uuid?: string; + /** + * + * @type {string} + * @memberof FormatTest + */ + password: string; + /** + * A string that is a 10 digit number. Can have leading zeros. + * @type {string} + * @memberof FormatTest + */ + patternWithDigits?: string; + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @type {string} + * @memberof FormatTest + */ + patternWithDigitsAndDelimiter?: string; +} + +/** + * Check if a given object implements the FormatTest interface. + */ +export function instanceOfFormatTest(value: object): value is FormatTest { + if (!('number' in value) || value['number'] === undefined) return false; + if ((!('_byte' in value) && !('byte' in value)) || (value['_byte'] === undefined && value['byte'] === undefined)) return false; + if (!('date' in value) || value['date'] === undefined) return false; + if (!('password' in value) || value['password'] === undefined) return false; + return true; +} + +export function FormatTestFromJSON(json: any): FormatTest { + return FormatTestFromJSONTyped(json, false); +} + +export function FormatTestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FormatTest { + if (json == null) { + return json; + } + return { + + 'integer': json['integer'] == null ? undefined : json['integer'], + 'int32': json['int32'] == null ? undefined : json['int32'], + 'int64': json['int64'] == null ? undefined : json['int64'], + 'number': json['number'], + '_float': json['float'] == null ? undefined : json['float'], + '_double': json['double'] == null ? undefined : json['double'], + 'decimal': json['decimal'] == null ? undefined : json['decimal'], + 'string': json['string'] == null ? undefined : json['string'], + '_byte': json['byte'], + 'binary': json['binary'] == null ? undefined : json['binary'], + 'date': (new Date(json['date'])), + 'dateTime': json['dateTime'] == null ? undefined : (new Date(json['dateTime'])), + 'uuid': json['uuid'] == null ? undefined : json['uuid'], + 'password': json['password'], + 'patternWithDigits': json['pattern_with_digits'] == null ? undefined : json['pattern_with_digits'], + 'patternWithDigitsAndDelimiter': json['pattern_with_digits_and_delimiter'] == null ? undefined : json['pattern_with_digits_and_delimiter'], + }; +} + +export function FormatTestToJSON(json: any): FormatTest { + return FormatTestToJSONTyped(json, false); +} + +export function FormatTestToJSONTyped(value?: FormatTest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'integer': value['integer'], + 'int32': value['int32'], + 'int64': value['int64'], + 'number': value['number'], + 'float': value['_float'], + 'double': value['_double'], + 'decimal': value['decimal'], + 'string': value['string'], + 'byte': value['_byte'], + 'binary': value['binary'], + 'date': value['date'].toISOString().substring(0,10), + 'dateTime': value['dateTime'] == null ? value['dateTime'] : value['dateTime'].toISOString(), + 'uuid': value['uuid'], + 'password': value['password'], + 'pattern_with_digits': value['patternWithDigits'], + 'pattern_with_digits_and_delimiter': value['patternWithDigitsAndDelimiter'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/has-only-read-only.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/has-only-read-only.ts new file mode 100644 index 000000000000..59019adf1993 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/has-only-read-only.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface HasOnlyReadOnly + */ +export interface HasOnlyReadOnly { + /** + * + * @type {string} + * @memberof HasOnlyReadOnly + */ + readonly bar?: string; + /** + * + * @type {string} + * @memberof HasOnlyReadOnly + */ + readonly foo?: string; +} + +/** + * Check if a given object implements the HasOnlyReadOnly interface. + */ +export function instanceOfHasOnlyReadOnly(value: object): value is HasOnlyReadOnly { + return true; +} + +export function HasOnlyReadOnlyFromJSON(json: any): HasOnlyReadOnly { + return HasOnlyReadOnlyFromJSONTyped(json, false); +} + +export function HasOnlyReadOnlyFromJSONTyped(json: any, ignoreDiscriminator: boolean): HasOnlyReadOnly { + if (json == null) { + return json; + } + return { + + 'bar': json['bar'] == null ? undefined : json['bar'], + 'foo': json['foo'] == null ? undefined : json['foo'], + }; +} + +export function HasOnlyReadOnlyToJSON(json: any): HasOnlyReadOnly { + return HasOnlyReadOnlyToJSONTyped(json, false); +} + +export function HasOnlyReadOnlyToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/health-check-result.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/health-check-result.ts new file mode 100644 index 000000000000..e8683a11f338 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/health-check-result.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * @export + * @interface HealthCheckResult + */ +export interface HealthCheckResult { + /** + * + * @type {string} + * @memberof HealthCheckResult + */ + nullableMessage?: string | null; +} + +/** + * Check if a given object implements the HealthCheckResult interface. + */ +export function instanceOfHealthCheckResult(value: object): value is HealthCheckResult { + return true; +} + +export function HealthCheckResultFromJSON(json: any): HealthCheckResult { + return HealthCheckResultFromJSONTyped(json, false); +} + +export function HealthCheckResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): HealthCheckResult { + if (json == null) { + return json; + } + return { + + 'nullableMessage': json['NullableMessage'] == null ? undefined : json['NullableMessage'], + }; +} + +export function HealthCheckResultToJSON(json: any): HealthCheckResult { + return HealthCheckResultToJSONTyped(json, false); +} + +export function HealthCheckResultToJSONTyped(value?: HealthCheckResult | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'NullableMessage': value['nullableMessage'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/index.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/index.ts new file mode 100644 index 000000000000..bc990f126516 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/index.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './additional-properties-class'; +export * from './all-of-with-single-ref'; +export * from './animal'; +export * from './array-of-array-of-number-only'; +export * from './array-of-number-only'; +export * from './array-test'; +export * from './capitalization'; +export * from './cat'; +export * from './category'; +export * from './child-with-nullable'; +export * from './class-model'; +export * from './client'; +export * from './deprecated-object'; +export * from './dog'; +export * from './enum-arrays'; +export * from './enum-class'; +export * from './enum-test'; +export * from './fake-big-decimal-map200-response'; +export * from './file-schema-test-class'; +export * from './foo'; +export * from './foo-get-default-response'; +export * from './format-test'; +export * from './has-only-read-only'; +export * from './health-check-result'; +export * from './list'; +export * from './map-test'; +export * from './mixed-properties-and-additional-properties-class'; +export * from './model200-response'; +export * from './model-api-response'; +export * from './model-file'; +export * from './name'; +export * from './nullable-class'; +export * from './number-only'; +export * from './object-with-deprecated-fields'; +export * from './order'; +export * from './outer-composite'; +export * from './outer-enum'; +export * from './outer-enum-default-value'; +export * from './outer-enum-integer'; +export * from './outer-enum-integer-default-value'; +export * from './outer-object-with-enum-property'; +export * from './parent-with-nullable'; +export * from './pet'; +export * from './read-only-first'; +export * from './return'; +export * from './single-ref-type'; +export * from './special-model-name'; +export * from './tag'; +export * from './test-inline-freeform-additional-properties-request'; +export * from './user'; diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/list.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/list.ts new file mode 100644 index 000000000000..21dd83e2c200 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/list.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface List + */ +export interface List { + /** + * + * @type {string} + * @memberof List + */ + _123list?: string; +} + +/** + * Check if a given object implements the List interface. + */ +export function instanceOfList(value: object): value is List { + return true; +} + +export function ListFromJSON(json: any): List { + return ListFromJSONTyped(json, false); +} + +export function ListFromJSONTyped(json: any, ignoreDiscriminator: boolean): List { + if (json == null) { + return json; + } + return { + + '_123list': json['123-list'] == null ? undefined : json['123-list'], + }; +} + +export function ListToJSON(json: any): List { + return ListToJSONTyped(json, false); +} + +export function ListToJSONTyped(value?: List | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '123-list': value['_123list'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/map-test.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/map-test.ts new file mode 100644 index 000000000000..c968578beb33 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/map-test.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface MapTest + */ +export interface MapTest { + /** + * + * @type {{ [key: string]: { [key: string]: string; }; }} + * @memberof MapTest + */ + mapMapOfString?: { [key: string]: { [key: string]: string; }; }; + /** + * + * @type {{ [key: string]: MapTestMapOfEnumStringEnum; }} + * @memberof MapTest + */ + mapOfEnumString?: { [key: string]: MapTestMapOfEnumStringEnum; }; + /** + * + * @type {{ [key: string]: boolean; }} + * @memberof MapTest + */ + directMap?: { [key: string]: boolean; }; + /** + * + * @type {{ [key: string]: boolean; }} + * @memberof MapTest + */ + indirectMap?: { [key: string]: boolean; }; +} + + +/** + * @export + */ +export const MapTestMapOfEnumStringEnum = { + Upper: 'UPPER', + Lower: 'lower' +} as const; +export type MapTestMapOfEnumStringEnum = typeof MapTestMapOfEnumStringEnum[keyof typeof MapTestMapOfEnumStringEnum]; + + +/** + * Check if a given object implements the MapTest interface. + */ +export function instanceOfMapTest(value: object): value is MapTest { + return true; +} + +export function MapTestFromJSON(json: any): MapTest { + return MapTestFromJSONTyped(json, false); +} + +export function MapTestFromJSONTyped(json: any, ignoreDiscriminator: boolean): MapTest { + if (json == null) { + return json; + } + return { + + 'mapMapOfString': json['map_map_of_string'] == null ? undefined : json['map_map_of_string'], + 'mapOfEnumString': json['map_of_enum_string'] == null ? undefined : json['map_of_enum_string'], + 'directMap': json['direct_map'] == null ? undefined : json['direct_map'], + 'indirectMap': json['indirect_map'] == null ? undefined : json['indirect_map'], + }; +} + +export function MapTestToJSON(json: any): MapTest { + return MapTestToJSONTyped(json, false); +} + +export function MapTestToJSONTyped(value?: MapTest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'map_map_of_string': value['mapMapOfString'], + 'map_of_enum_string': value['mapOfEnumString'], + 'direct_map': value['directMap'], + 'indirect_map': value['indirectMap'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/mixed-properties-and-additional-properties-class.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/mixed-properties-and-additional-properties-class.ts new file mode 100644 index 000000000000..d557bcda3a6c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/mixed-properties-and-additional-properties-class.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { Animal } from './animal'; +import { + AnimalFromJSON, + AnimalFromJSONTyped, + AnimalToJSON, + AnimalToJSONTyped, +} from './animal'; + +/** + * + * @export + * @interface MixedPropertiesAndAdditionalPropertiesClass + */ +export interface MixedPropertiesAndAdditionalPropertiesClass { + /** + * + * @type {string} + * @memberof MixedPropertiesAndAdditionalPropertiesClass + */ + uuid?: string; + /** + * + * @type {Date} + * @memberof MixedPropertiesAndAdditionalPropertiesClass + */ + dateTime?: Date; + /** + * + * @type {{ [key: string]: Animal; }} + * @memberof MixedPropertiesAndAdditionalPropertiesClass + */ + map?: { [key: string]: Animal; }; +} + +/** + * Check if a given object implements the MixedPropertiesAndAdditionalPropertiesClass interface. + */ +export function instanceOfMixedPropertiesAndAdditionalPropertiesClass(value: object): value is MixedPropertiesAndAdditionalPropertiesClass { + return true; +} + +export function MixedPropertiesAndAdditionalPropertiesClassFromJSON(json: any): MixedPropertiesAndAdditionalPropertiesClass { + return MixedPropertiesAndAdditionalPropertiesClassFromJSONTyped(json, false); +} + +export function MixedPropertiesAndAdditionalPropertiesClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): MixedPropertiesAndAdditionalPropertiesClass { + if (json == null) { + return json; + } + return { + + 'uuid': json['uuid'] == null ? undefined : json['uuid'], + 'dateTime': json['dateTime'] == null ? undefined : (new Date(json['dateTime'])), + 'map': json['map'] == null ? undefined : (mapValues(json['map'], AnimalFromJSON)), + }; +} + +export function MixedPropertiesAndAdditionalPropertiesClassToJSON(json: any): MixedPropertiesAndAdditionalPropertiesClass { + return MixedPropertiesAndAdditionalPropertiesClassToJSONTyped(json, false); +} + +export function MixedPropertiesAndAdditionalPropertiesClassToJSONTyped(value?: MixedPropertiesAndAdditionalPropertiesClass | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'uuid': value['uuid'], + 'dateTime': value['dateTime'] == null ? value['dateTime'] : value['dateTime'].toISOString(), + 'map': value['map'] == null ? undefined : (mapValues(value['map'], AnimalToJSON)), + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model-api-response.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model-api-response.ts new file mode 100644 index 000000000000..355b5f76e428 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model-api-response.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface ModelApiResponse + */ +export interface ModelApiResponse { + /** + * + * @type {number} + * @memberof ModelApiResponse + */ + code?: number; + /** + * + * @type {string} + * @memberof ModelApiResponse + */ + type?: string; + /** + * + * @type {string} + * @memberof ModelApiResponse + */ + message?: string; +} + +/** + * Check if a given object implements the ModelApiResponse interface. + */ +export function instanceOfModelApiResponse(value: object): value is ModelApiResponse { + return true; +} + +export function ModelApiResponseFromJSON(json: any): ModelApiResponse { + return ModelApiResponseFromJSONTyped(json, false); +} + +export function ModelApiResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelApiResponse { + if (json == null) { + return json; + } + return { + + 'code': json['code'] == null ? undefined : json['code'], + 'type': json['type'] == null ? undefined : json['type'], + 'message': json['message'] == null ? undefined : json['message'], + }; +} + +export function ModelApiResponseToJSON(json: any): ModelApiResponse { + return ModelApiResponseToJSONTyped(json, false); +} + +export function ModelApiResponseToJSONTyped(value?: ModelApiResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'code': value['code'], + 'type': value['type'], + 'message': value['message'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model-file.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model-file.ts new file mode 100644 index 000000000000..4b63fcfe25f2 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model-file.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * Must be named `File` for test. + * @export + * @interface ModelFile + */ +export interface ModelFile { + /** + * Test capitalization + * @type {string} + * @memberof ModelFile + */ + sourceURI?: string; +} + +/** + * Check if a given object implements the ModelFile interface. + */ +export function instanceOfModelFile(value: object): value is ModelFile { + return true; +} + +export function ModelFileFromJSON(json: any): ModelFile { + return ModelFileFromJSONTyped(json, false); +} + +export function ModelFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelFile { + if (json == null) { + return json; + } + return { + + 'sourceURI': json['sourceURI'] == null ? undefined : json['sourceURI'], + }; +} + +export function ModelFileToJSON(json: any): ModelFile { + return ModelFileToJSONTyped(json, false); +} + +export function ModelFileToJSONTyped(value?: ModelFile | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sourceURI': value['sourceURI'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model200-response.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model200-response.ts new file mode 100644 index 000000000000..b0a30640133e --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/model200-response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * Model for testing model name starting with number + * @export + * @interface Model200Response + */ +export interface Model200Response { + /** + * + * @type {number} + * @memberof Model200Response + */ + name?: number; + /** + * + * @type {string} + * @memberof Model200Response + */ + _class?: string; +} + +/** + * Check if a given object implements the Model200Response interface. + */ +export function instanceOfModel200Response(value: object): value is Model200Response { + return true; +} + +export function Model200ResponseFromJSON(json: any): Model200Response { + return Model200ResponseFromJSONTyped(json, false); +} + +export function Model200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Model200Response { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + '_class': json['class'] == null ? undefined : json['class'], + }; +} + +export function Model200ResponseToJSON(json: any): Model200Response { + return Model200ResponseToJSONTyped(json, false); +} + +export function Model200ResponseToJSONTyped(value?: Model200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'class': value['_class'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/name.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/name.ts new file mode 100644 index 000000000000..b999bdccb1d0 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/name.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * Model for testing model name same as property name + * @export + * @interface Name + */ +export interface Name { + /** + * + * @type {number} + * @memberof Name + */ + name: number; + /** + * + * @type {number} + * @memberof Name + */ + readonly snakeCase?: number; + /** + * + * @type {string} + * @memberof Name + */ + property?: string; + /** + * + * @type {number} + * @memberof Name + */ + readonly _123number?: number; +} + +/** + * Check if a given object implements the Name interface. + */ +export function instanceOfName(value: object): value is Name { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function NameFromJSON(json: any): Name { + return NameFromJSONTyped(json, false); +} + +export function NameFromJSONTyped(json: any, ignoreDiscriminator: boolean): Name { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'snakeCase': json['snake_case'] == null ? undefined : json['snake_case'], + 'property': json['property'] == null ? undefined : json['property'], + '_123number': json['123Number'] == null ? undefined : json['123Number'], + }; +} + +export function NameToJSON(json: any): Name { + return NameToJSONTyped(json, false); +} + +export function NameToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'property': value['property'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/nullable-class.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/nullable-class.ts new file mode 100644 index 000000000000..11b2fb30dae8 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/nullable-class.ts @@ -0,0 +1,156 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface NullableClass + */ +export interface NullableClass { + [key: string]: object | any; + /** + * + * @type {number} + * @memberof NullableClass + */ + integerProp?: number | null; + /** + * + * @type {number} + * @memberof NullableClass + */ + numberProp?: number | null; + /** + * + * @type {boolean} + * @memberof NullableClass + */ + booleanProp?: boolean | null; + /** + * + * @type {string} + * @memberof NullableClass + */ + stringProp?: string | null; + /** + * + * @type {Date} + * @memberof NullableClass + */ + dateProp?: Date | null; + /** + * + * @type {Date} + * @memberof NullableClass + */ + datetimeProp?: Date | null; + /** + * + * @type {Array} + * @memberof NullableClass + */ + arrayNullableProp?: Array | null; + /** + * + * @type {Array} + * @memberof NullableClass + */ + arrayAndItemsNullableProp?: Array | null; + /** + * + * @type {Array} + * @memberof NullableClass + */ + arrayItemsNullable?: Array; + /** + * + * @type {{ [key: string]: object; }} + * @memberof NullableClass + */ + objectNullableProp?: { [key: string]: object; } | null; + /** + * + * @type {{ [key: string]: object | null; }} + * @memberof NullableClass + */ + objectAndItemsNullableProp?: { [key: string]: object | null; } | null; + /** + * + * @type {{ [key: string]: object | null; }} + * @memberof NullableClass + */ + objectItemsNullable?: { [key: string]: object | null; }; +} + +/** + * Check if a given object implements the NullableClass interface. + */ +export function instanceOfNullableClass(value: object): value is NullableClass { + return true; +} + +export function NullableClassFromJSON(json: any): NullableClass { + return NullableClassFromJSONTyped(json, false); +} + +export function NullableClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): NullableClass { + if (json == null) { + return json; + } + return { + + ...json, + 'integerProp': json['integer_prop'] == null ? undefined : json['integer_prop'], + 'numberProp': json['number_prop'] == null ? undefined : json['number_prop'], + 'booleanProp': json['boolean_prop'] == null ? undefined : json['boolean_prop'], + 'stringProp': json['string_prop'] == null ? undefined : json['string_prop'], + 'dateProp': json['date_prop'] == null ? undefined : (new Date(json['date_prop'])), + 'datetimeProp': json['datetime_prop'] == null ? undefined : (new Date(json['datetime_prop'])), + 'arrayNullableProp': json['array_nullable_prop'] == null ? undefined : json['array_nullable_prop'], + 'arrayAndItemsNullableProp': json['array_and_items_nullable_prop'] == null ? undefined : json['array_and_items_nullable_prop'], + 'arrayItemsNullable': json['array_items_nullable'] == null ? undefined : json['array_items_nullable'], + 'objectNullableProp': json['object_nullable_prop'] == null ? undefined : json['object_nullable_prop'], + 'objectAndItemsNullableProp': json['object_and_items_nullable_prop'] == null ? undefined : json['object_and_items_nullable_prop'], + 'objectItemsNullable': json['object_items_nullable'] == null ? undefined : json['object_items_nullable'], + }; +} + +export function NullableClassToJSON(json: any): NullableClass { + return NullableClassToJSONTyped(json, false); +} + +export function NullableClassToJSONTyped(value?: NullableClass | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'integer_prop': value['integerProp'], + 'number_prop': value['numberProp'], + 'boolean_prop': value['booleanProp'], + 'string_prop': value['stringProp'], + 'date_prop': value['dateProp'] == null ? value['dateProp'] : value['dateProp'].toISOString().substring(0,10), + 'datetime_prop': value['datetimeProp'] == null ? value['datetimeProp'] : value['datetimeProp'].toISOString(), + 'array_nullable_prop': value['arrayNullableProp'], + 'array_and_items_nullable_prop': value['arrayAndItemsNullableProp'], + 'array_items_nullable': value['arrayItemsNullable'], + 'object_nullable_prop': value['objectNullableProp'], + 'object_and_items_nullable_prop': value['objectAndItemsNullableProp'], + 'object_items_nullable': value['objectItemsNullable'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/number-only.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/number-only.ts new file mode 100644 index 000000000000..01ffc388797b --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/number-only.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface NumberOnly + */ +export interface NumberOnly { + /** + * + * @type {number} + * @memberof NumberOnly + */ + justNumber?: number; +} + +/** + * Check if a given object implements the NumberOnly interface. + */ +export function instanceOfNumberOnly(value: object): value is NumberOnly { + return true; +} + +export function NumberOnlyFromJSON(json: any): NumberOnly { + return NumberOnlyFromJSONTyped(json, false); +} + +export function NumberOnlyFromJSONTyped(json: any, ignoreDiscriminator: boolean): NumberOnly { + if (json == null) { + return json; + } + return { + + 'justNumber': json['JustNumber'] == null ? undefined : json['JustNumber'], + }; +} + +export function NumberOnlyToJSON(json: any): NumberOnly { + return NumberOnlyToJSONTyped(json, false); +} + +export function NumberOnlyToJSONTyped(value?: NumberOnly | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'JustNumber': value['justNumber'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/object-with-deprecated-fields.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/object-with-deprecated-fields.ts new file mode 100644 index 000000000000..3e6dbe58bc72 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/object-with-deprecated-fields.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { DeprecatedObject } from './deprecated-object'; +import { + DeprecatedObjectFromJSON, + DeprecatedObjectFromJSONTyped, + DeprecatedObjectToJSON, + DeprecatedObjectToJSONTyped, +} from './deprecated-object'; + +/** + * + * @export + * @interface ObjectWithDeprecatedFields + */ +export interface ObjectWithDeprecatedFields { + /** + * + * @type {string} + * @memberof ObjectWithDeprecatedFields + */ + uuid?: string; + /** + * + * @type {number} + * @memberof ObjectWithDeprecatedFields + * @deprecated + */ + id?: number; + /** + * + * @type {DeprecatedObject} + * @memberof ObjectWithDeprecatedFields + * @deprecated + */ + deprecatedRef?: DeprecatedObject; + /** + * + * @type {Array} + * @memberof ObjectWithDeprecatedFields + * @deprecated + */ + bars?: Array; +} + +/** + * Check if a given object implements the ObjectWithDeprecatedFields interface. + */ +export function instanceOfObjectWithDeprecatedFields(value: object): value is ObjectWithDeprecatedFields { + return true; +} + +export function ObjectWithDeprecatedFieldsFromJSON(json: any): ObjectWithDeprecatedFields { + return ObjectWithDeprecatedFieldsFromJSONTyped(json, false); +} + +export function ObjectWithDeprecatedFieldsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ObjectWithDeprecatedFields { + if (json == null) { + return json; + } + return { + + 'uuid': json['uuid'] == null ? undefined : json['uuid'], + 'id': json['id'] == null ? undefined : json['id'], + 'deprecatedRef': json['deprecatedRef'] == null ? undefined : DeprecatedObjectFromJSON(json['deprecatedRef']), + 'bars': json['bars'] == null ? undefined : json['bars'], + }; +} + +export function ObjectWithDeprecatedFieldsToJSON(json: any): ObjectWithDeprecatedFields { + return ObjectWithDeprecatedFieldsToJSONTyped(json, false); +} + +export function ObjectWithDeprecatedFieldsToJSONTyped(value?: ObjectWithDeprecatedFields | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'uuid': value['uuid'], + 'id': value['id'], + 'deprecatedRef': DeprecatedObjectToJSON(value['deprecatedRef']), + 'bars': value['bars'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/order.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/order.ts new file mode 100644 index 000000000000..e4e905c98d1c --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/order.ts @@ -0,0 +1,117 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + id?: number; + /** + * + * @type {number} + * @memberof Order + */ + petId?: number; + /** + * + * @type {number} + * @memberof Order + */ + quantity?: number; + /** + * + * @type {Date} + * @memberof Order + */ + shipDate?: Date; + /** + * Order Status + * @type {OrderStatusEnum} + * @memberof Order + */ + status?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + complete?: boolean; +} + + +/** + * @export + */ +export const OrderStatusEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; +export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum]; + + +/** + * Check if a given object implements the Order interface. + */ +export function instanceOfOrder(value: object): value is Order { + return true; +} + +export function OrderFromJSON(json: any): Order { + return OrderFromJSONTyped(json, false); +} + +export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Order { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'petId': json['petId'] == null ? undefined : json['petId'], + 'quantity': json['quantity'] == null ? undefined : json['quantity'], + 'shipDate': json['shipDate'] == null ? undefined : (new Date(json['shipDate'])), + 'status': json['status'] == null ? undefined : json['status'], + 'complete': json['complete'] == null ? undefined : json['complete'], + }; +} + +export function OrderToJSON(json: any): Order { + return OrderToJSONTyped(json, false); +} + +export function OrderToJSONTyped(value?: Order | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'petId': value['petId'], + 'quantity': value['quantity'], + 'shipDate': value['shipDate'] == null ? value['shipDate'] : value['shipDate'].toISOString(), + 'status': value['status'], + 'complete': value['complete'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-composite.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-composite.ts new file mode 100644 index 000000000000..ffb9d35f81ae --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-composite.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface OuterComposite + */ +export interface OuterComposite { + /** + * + * @type {number} + * @memberof OuterComposite + */ + myNumber?: number; + /** + * + * @type {string} + * @memberof OuterComposite + */ + myString?: string; + /** + * + * @type {boolean} + * @memberof OuterComposite + */ + myBoolean?: boolean; +} + +/** + * Check if a given object implements the OuterComposite interface. + */ +export function instanceOfOuterComposite(value: object): value is OuterComposite { + return true; +} + +export function OuterCompositeFromJSON(json: any): OuterComposite { + return OuterCompositeFromJSONTyped(json, false); +} + +export function OuterCompositeFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterComposite { + if (json == null) { + return json; + } + return { + + 'myNumber': json['my_number'] == null ? undefined : json['my_number'], + 'myString': json['my_string'] == null ? undefined : json['my_string'], + 'myBoolean': json['my_boolean'] == null ? undefined : json['my_boolean'], + }; +} + +export function OuterCompositeToJSON(json: any): OuterComposite { + return OuterCompositeToJSONTyped(json, false); +} + +export function OuterCompositeToJSONTyped(value?: OuterComposite | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'my_number': value['myNumber'], + 'my_string': value['myString'], + 'my_boolean': value['myBoolean'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-default-value.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-default-value.ts new file mode 100644 index 000000000000..de44a7878120 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-default-value.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 OuterEnumDefaultValue = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; +export type OuterEnumDefaultValue = typeof OuterEnumDefaultValue[keyof typeof OuterEnumDefaultValue]; + + +export function instanceOfOuterEnumDefaultValue(value: any): boolean { + for (const key in OuterEnumDefaultValue) { + if (Object.prototype.hasOwnProperty.call(OuterEnumDefaultValue, key)) { + if (OuterEnumDefaultValue[key as keyof typeof OuterEnumDefaultValue] === value) { + return true; + } + } + } + return false; +} + +export function OuterEnumDefaultValueFromJSON(json: any): OuterEnumDefaultValue { + return OuterEnumDefaultValueFromJSONTyped(json, false); +} + +export function OuterEnumDefaultValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterEnumDefaultValue { + return json as OuterEnumDefaultValue; +} + +export function OuterEnumDefaultValueToJSON(value?: OuterEnumDefaultValue | null): any { + return value as any; +} + +export function OuterEnumDefaultValueToJSONTyped(value: any, ignoreDiscriminator: boolean): OuterEnumDefaultValue { + return value as OuterEnumDefaultValue; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer-default-value.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer-default-value.ts new file mode 100644 index 000000000000..1a6941699214 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer-default-value.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 OuterEnumIntegerDefaultValue = { + NUMBER_0: 0, + NUMBER_1: 1, + NUMBER_2: 2 +} as const; +export type OuterEnumIntegerDefaultValue = typeof OuterEnumIntegerDefaultValue[keyof typeof OuterEnumIntegerDefaultValue]; + + +export function instanceOfOuterEnumIntegerDefaultValue(value: any): boolean { + for (const key in OuterEnumIntegerDefaultValue) { + if (Object.prototype.hasOwnProperty.call(OuterEnumIntegerDefaultValue, key)) { + if (OuterEnumIntegerDefaultValue[key as keyof typeof OuterEnumIntegerDefaultValue] === value) { + return true; + } + } + } + return false; +} + +export function OuterEnumIntegerDefaultValueFromJSON(json: any): OuterEnumIntegerDefaultValue { + return OuterEnumIntegerDefaultValueFromJSONTyped(json, false); +} + +export function OuterEnumIntegerDefaultValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterEnumIntegerDefaultValue { + return json as OuterEnumIntegerDefaultValue; +} + +export function OuterEnumIntegerDefaultValueToJSON(value?: OuterEnumIntegerDefaultValue | null): any { + return value as any; +} + +export function OuterEnumIntegerDefaultValueToJSONTyped(value: any, ignoreDiscriminator: boolean): OuterEnumIntegerDefaultValue { + return value as OuterEnumIntegerDefaultValue; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer.ts new file mode 100644 index 000000000000..b899dc358ea0 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum-integer.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 OuterEnumInteger = { + NUMBER_0: 0, + NUMBER_1: 1, + NUMBER_2: 2 +} as const; +export type OuterEnumInteger = typeof OuterEnumInteger[keyof typeof OuterEnumInteger]; + + +export function instanceOfOuterEnumInteger(value: any): boolean { + for (const key in OuterEnumInteger) { + if (Object.prototype.hasOwnProperty.call(OuterEnumInteger, key)) { + if (OuterEnumInteger[key as keyof typeof OuterEnumInteger] === value) { + return true; + } + } + } + return false; +} + +export function OuterEnumIntegerFromJSON(json: any): OuterEnumInteger { + return OuterEnumIntegerFromJSONTyped(json, false); +} + +export function OuterEnumIntegerFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterEnumInteger { + return json as OuterEnumInteger; +} + +export function OuterEnumIntegerToJSON(value?: OuterEnumInteger | null): any { + return value as any; +} + +export function OuterEnumIntegerToJSONTyped(value: any, ignoreDiscriminator: boolean): OuterEnumInteger { + return value as OuterEnumInteger; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum.ts new file mode 100644 index 000000000000..4be9edeac589 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-enum.ts @@ -0,0 +1,54 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 OuterEnum = { + Placed: 'placed', + Approved: 'approved', + Delivered: 'delivered' +} as const; +export type OuterEnum = typeof OuterEnum[keyof typeof OuterEnum]; + + +export function instanceOfOuterEnum(value: any): boolean { + for (const key in OuterEnum) { + if (Object.prototype.hasOwnProperty.call(OuterEnum, key)) { + if (OuterEnum[key as keyof typeof OuterEnum] === value) { + return true; + } + } + } + return false; +} + +export function OuterEnumFromJSON(json: any): OuterEnum { + return OuterEnumFromJSONTyped(json, false); +} + +export function OuterEnumFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterEnum { + return json as OuterEnum; +} + +export function OuterEnumToJSON(value?: OuterEnum | null): any { + return value as any; +} + +export function OuterEnumToJSONTyped(value: any, ignoreDiscriminator: boolean): OuterEnum { + return value as OuterEnum; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-object-with-enum-property.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-object-with-enum-property.ts new file mode 100644 index 000000000000..bcb3b680d283 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/outer-object-with-enum-property.ts @@ -0,0 +1,76 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { OuterEnumInteger } from './outer-enum-integer'; +import { + OuterEnumIntegerFromJSON, + OuterEnumIntegerFromJSONTyped, + OuterEnumIntegerToJSON, + OuterEnumIntegerToJSONTyped, +} from './outer-enum-integer'; + +/** + * + * @export + * @interface OuterObjectWithEnumProperty + */ +export interface OuterObjectWithEnumProperty { + /** + * + * @type {OuterEnumInteger} + * @memberof OuterObjectWithEnumProperty + */ + value: OuterEnumInteger; +} + + + +/** + * Check if a given object implements the OuterObjectWithEnumProperty interface. + */ +export function instanceOfOuterObjectWithEnumProperty(value: object): value is OuterObjectWithEnumProperty { + if (!('value' in value) || value['value'] === undefined) return false; + return true; +} + +export function OuterObjectWithEnumPropertyFromJSON(json: any): OuterObjectWithEnumProperty { + return OuterObjectWithEnumPropertyFromJSONTyped(json, false); +} + +export function OuterObjectWithEnumPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): OuterObjectWithEnumProperty { + if (json == null) { + return json; + } + return { + + 'value': OuterEnumIntegerFromJSON(json['value']), + }; +} + +export function OuterObjectWithEnumPropertyToJSON(json: any): OuterObjectWithEnumProperty { + return OuterObjectWithEnumPropertyToJSONTyped(json, false); +} + +export function OuterObjectWithEnumPropertyToJSONTyped(value?: OuterObjectWithEnumProperty | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': OuterEnumIntegerToJSON(value['value']), + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/parent-with-nullable.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/parent-with-nullable.ts new file mode 100644 index 000000000000..b642ba20f314 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/parent-with-nullable.ts @@ -0,0 +1,99 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 ChildWithNullable, ChildWithNullableFromJSONTyped, ChildWithNullableToJSON, ChildWithNullableToJSONTyped } from './ChildWithNullable'; +/** + * + * @export + * @interface ParentWithNullable + */ +export interface ParentWithNullable { + /** + * + * @type {ParentWithNullableTypeEnum} + * @memberof ParentWithNullable + */ + type?: ParentWithNullableTypeEnum; + /** + * + * @type {string} + * @memberof ParentWithNullable + */ + nullableProperty?: string | null; +} + + +/** + * @export + */ +export const ParentWithNullableTypeEnum = { + ChildWithNullable: 'ChildWithNullable' +} as const; +export type ParentWithNullableTypeEnum = typeof ParentWithNullableTypeEnum[keyof typeof ParentWithNullableTypeEnum]; + + +/** + * Check if a given object implements the ParentWithNullable interface. + */ +export function instanceOfParentWithNullable(value: object): value is ParentWithNullable { + return true; +} + +export function ParentWithNullableFromJSON(json: any): ParentWithNullable { + return ParentWithNullableFromJSONTyped(json, false); +} + +export function ParentWithNullableFromJSONTyped(json: any, ignoreDiscriminator: boolean): ParentWithNullable { + if (json == null) { + return json; + } + if (!ignoreDiscriminator) { + if (json['type'] === 'ChildWithNullable') { + return ChildWithNullableFromJSONTyped(json, ignoreDiscriminator); + } + + } + return { + + 'type': json['type'] == null ? undefined : json['type'], + 'nullableProperty': json['nullableProperty'] == null ? undefined : json['nullableProperty'], + }; +} + +export function ParentWithNullableToJSON(json: any): ParentWithNullable { + return ParentWithNullableToJSONTyped(json, false); +} + +export function ParentWithNullableToJSONTyped(value?: ParentWithNullable | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + if (!ignoreDiscriminator) { + switch (value['type']) { + case 'ChildWithNullable': + return ChildWithNullableToJSONTyped(value as ChildWithNullable, ignoreDiscriminator); + default: + return value; + } + } + + return { + + 'type': value['type'], + 'nullableProperty': value['nullableProperty'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/pet.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/pet.ts new file mode 100644 index 000000000000..1020b4a4b374 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/pet.ts @@ -0,0 +1,134 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 { Category } from './category'; +import { + CategoryFromJSON, + CategoryFromJSONTyped, + CategoryToJSON, + CategoryToJSONTyped, +} from './category'; +import type { Tag } from './tag'; +import { + TagFromJSON, + TagFromJSONTyped, + TagToJSON, + TagToJSONTyped, +} from './tag'; + +/** + * + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + id?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + category?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + name: string; + /** + * + * @type {Set} + * @memberof Pet + */ + photoUrls: Set; + /** + * + * @type {Array} + * @memberof Pet + */ + tags?: Array; + /** + * pet status in the store + * @type {PetStatusEnum} + * @memberof Pet + */ + status?: PetStatusEnum; +} + + +/** + * @export + */ +export const PetStatusEnum = { + Available: 'available', + Pending: 'pending', + Sold: 'sold' +} as const; +export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; + + +/** + * Check if a given object implements the Pet interface. + */ +export function instanceOfPet(value: object): value is Pet { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('photoUrls' in value) || value['photoUrls'] === undefined) return false; + return true; +} + +export function PetFromJSON(json: any): Pet { + return PetFromJSONTyped(json, false); +} + +export function PetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pet { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'category': json['category'] == null ? undefined : CategoryFromJSON(json['category']), + 'name': json['name'], + 'photoUrls': new Set(json['photoUrls']), + 'tags': json['tags'] == null ? undefined : ((json['tags'] as Array).map(TagFromJSON)), + 'status': json['status'] == null ? undefined : json['status'], + }; +} + +export function PetToJSON(json: any): Pet { + return PetToJSONTyped(json, false); +} + +export function PetToJSONTyped(value?: Pet | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'category': CategoryToJSON(value['category']), + 'name': value['name'], + 'photoUrls': Array.from(value['photoUrls'] as Set), + 'tags': value['tags'] == null ? undefined : ((value['tags'] as Array).map(TagToJSON)), + 'status': value['status'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/read-only-first.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/read-only-first.ts new file mode 100644 index 000000000000..38dbd2fbf41a --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/read-only-first.ts @@ -0,0 +1,72 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface ReadOnlyFirst + */ +export interface ReadOnlyFirst { + /** + * + * @type {string} + * @memberof ReadOnlyFirst + */ + readonly bar?: string; + /** + * + * @type {string} + * @memberof ReadOnlyFirst + */ + baz?: string; +} + +/** + * Check if a given object implements the ReadOnlyFirst interface. + */ +export function instanceOfReadOnlyFirst(value: object): value is ReadOnlyFirst { + return true; +} + +export function ReadOnlyFirstFromJSON(json: any): ReadOnlyFirst { + return ReadOnlyFirstFromJSONTyped(json, false); +} + +export function ReadOnlyFirstFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReadOnlyFirst { + if (json == null) { + return json; + } + return { + + 'bar': json['bar'] == null ? undefined : json['bar'], + 'baz': json['baz'] == null ? undefined : json['baz'], + }; +} + +export function ReadOnlyFirstToJSON(json: any): ReadOnlyFirst { + return ReadOnlyFirstToJSONTyped(json, false); +} + +export function ReadOnlyFirstToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'baz': value['baz'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/return.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/return.ts new file mode 100644 index 000000000000..557bb0d67195 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/return.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * Model for testing reserved words + * @export + * @interface Return + */ +export interface Return { + /** + * + * @type {number} + * @memberof Return + */ + _return?: number; +} + +/** + * Check if a given object implements the Return interface. + */ +export function instanceOfReturn(value: object): value is Return { + return true; +} + +export function ReturnFromJSON(json: any): Return { + return ReturnFromJSONTyped(json, false); +} + +export function ReturnFromJSONTyped(json: any, ignoreDiscriminator: boolean): Return { + if (json == null) { + return json; + } + return { + + '_return': json['return'] == null ? undefined : json['return'], + }; +} + +export function ReturnToJSON(json: any): Return { + return ReturnToJSONTyped(json, false); +} + +export function ReturnToJSONTyped(value?: Return | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'return': value['_return'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/single-ref-type.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/single-ref-type.ts new file mode 100644 index 000000000000..8247fdf99d23 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/single-ref-type.ts @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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 SingleRefType = { + Admin: 'admin', + User: 'user' +} as const; +export type SingleRefType = typeof SingleRefType[keyof typeof SingleRefType]; + + +export function instanceOfSingleRefType(value: any): boolean { + for (const key in SingleRefType) { + if (Object.prototype.hasOwnProperty.call(SingleRefType, key)) { + if (SingleRefType[key as keyof typeof SingleRefType] === value) { + return true; + } + } + } + return false; +} + +export function SingleRefTypeFromJSON(json: any): SingleRefType { + return SingleRefTypeFromJSONTyped(json, false); +} + +export function SingleRefTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SingleRefType { + return json as SingleRefType; +} + +export function SingleRefTypeToJSON(value?: SingleRefType | null): any { + return value as any; +} + +export function SingleRefTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SingleRefType { + return value as SingleRefType; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/special-model-name.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/special-model-name.ts new file mode 100644 index 000000000000..5ad3c16ca096 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/special-model-name.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface SpecialModelName + */ +export interface SpecialModelName { + /** + * + * @type {number} + * @memberof SpecialModelName + */ + $specialPropertyName?: number; +} + +/** + * Check if a given object implements the SpecialModelName interface. + */ +export function instanceOfSpecialModelName(value: object): value is SpecialModelName { + return true; +} + +export function SpecialModelNameFromJSON(json: any): SpecialModelName { + return SpecialModelNameFromJSONTyped(json, false); +} + +export function SpecialModelNameFromJSONTyped(json: any, ignoreDiscriminator: boolean): SpecialModelName { + if (json == null) { + return json; + } + return { + + '$specialPropertyName': json['$special[property.name]'] == null ? undefined : json['$special[property.name]'], + }; +} + +export function SpecialModelNameToJSON(json: any): SpecialModelName { + return SpecialModelNameToJSONTyped(json, false); +} + +export function SpecialModelNameToJSONTyped(value?: SpecialModelName | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + '$special[property.name]': value['$specialPropertyName'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/tag.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/tag.ts new file mode 100644 index 000000000000..c8711cf09f01 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/tag.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + id?: number; + /** + * + * @type {string} + * @memberof Tag + */ + name?: string; +} + +/** + * Check if a given object implements the Tag interface. + */ +export function instanceOfTag(value: object): value is Tag { + return true; +} + +export function TagFromJSON(json: any): Tag { + return TagFromJSONTyped(json, false); +} + +export function TagFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tag { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + }; +} + +export function TagToJSON(json: any): Tag { + return TagToJSONTyped(json, false); +} + +export function TagToJSONTyped(value?: Tag | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/test-inline-freeform-additional-properties-request.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/test-inline-freeform-additional-properties-request.ts new file mode 100644 index 000000000000..025e2205b096 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/test-inline-freeform-additional-properties-request.ts @@ -0,0 +1,68 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface TestInlineFreeformAdditionalPropertiesRequest + */ +export interface TestInlineFreeformAdditionalPropertiesRequest { + [key: string]: any | any; + /** + * + * @type {string} + * @memberof TestInlineFreeformAdditionalPropertiesRequest + */ + someProperty?: string; +} + +/** + * Check if a given object implements the TestInlineFreeformAdditionalPropertiesRequest interface. + */ +export function instanceOfTestInlineFreeformAdditionalPropertiesRequest(value: object): value is TestInlineFreeformAdditionalPropertiesRequest { + return true; +} + +export function TestInlineFreeformAdditionalPropertiesRequestFromJSON(json: any): TestInlineFreeformAdditionalPropertiesRequest { + return TestInlineFreeformAdditionalPropertiesRequestFromJSONTyped(json, false); +} + +export function TestInlineFreeformAdditionalPropertiesRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TestInlineFreeformAdditionalPropertiesRequest { + if (json == null) { + return json; + } + return { + + ...json, + 'someProperty': json['someProperty'] == null ? undefined : json['someProperty'], + }; +} + +export function TestInlineFreeformAdditionalPropertiesRequestToJSON(json: any): TestInlineFreeformAdditionalPropertiesRequest { + return TestInlineFreeformAdditionalPropertiesRequestToJSONTyped(json, false); +} + +export function TestInlineFreeformAdditionalPropertiesRequestToJSONTyped(value?: TestInlineFreeformAdditionalPropertiesRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'someProperty': value['someProperty'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/models/user.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/user.ts new file mode 100644 index 000000000000..854f2dae12f5 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/models/user.ts @@ -0,0 +1,121 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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'; +/** + * + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + id?: number; + /** + * + * @type {string} + * @memberof User + */ + username?: string; + /** + * + * @type {string} + * @memberof User + */ + firstName?: string; + /** + * + * @type {string} + * @memberof User + */ + lastName?: string; + /** + * + * @type {string} + * @memberof User + */ + email?: string; + /** + * + * @type {string} + * @memberof User + */ + password?: string; + /** + * + * @type {string} + * @memberof User + */ + phone?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + userStatus?: number; +} + +/** + * Check if a given object implements the User interface. + */ +export function instanceOfUser(value: object): value is User { + return true; +} + +export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'username': json['username'] == null ? undefined : json['username'], + 'firstName': json['firstName'] == null ? undefined : json['firstName'], + 'lastName': json['lastName'] == null ? undefined : json['lastName'], + 'email': json['email'] == null ? undefined : json['email'], + 'password': json['password'] == null ? undefined : json['password'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'userStatus': json['userStatus'] == null ? undefined : json['userStatus'], + }; +} + +export function UserToJSON(json: any): User { + return UserToJSONTyped(json, false); +} + +export function UserToJSONTyped(value?: User | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'username': value['username'], + 'firstName': value['firstName'], + 'lastName': value['lastName'], + 'email': value['email'], + 'password': value['password'], + 'phone': value['phone'], + 'userStatus': value['userStatus'], + }; +} + diff --git a/samples/client/petstore/typescript-fetch/builds/kebab-case/runtime.ts b/samples/client/petstore/typescript-fetch/builds/kebab-case/runtime.ts new file mode 100644 index 000000000000..750df2544f71 --- /dev/null +++ b/samples/client/petstore/typescript-fetch/builds/kebab-case/runtime.ts @@ -0,0 +1,449 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.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://petstore.swagger.io:80/v2".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 = /^(:?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); + + // restore prototype chain + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(this, actualProto); + } + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + + // restore prototype chain + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(this, actualProto); + } + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + + // restore prototype chain + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(this, actualProto); + } + } +} + +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(); + }; +}