diff --git a/test/__snapshots__/index.spec.js.snap b/test/__snapshots__/index.spec.js.snap index d3c6ad3a..fa3d295b 100644 --- a/test/__snapshots__/index.spec.js.snap +++ b/test/__snapshots__/index.spec.js.snap @@ -381,6 +381,7 @@ export { $SimpleReference } from './schemas/$SimpleReference'; export { $SimpleString } from './schemas/$SimpleString'; export { $SimpleStringWithPattern } from './schemas/$SimpleStringWithPattern'; +export { CollectionFormatService } from './services/CollectionFormatService'; export { ComplexService } from './services/ComplexService'; export { DefaultsService } from './services/DefaultsService'; export { DuplicateService } from './services/DuplicateService'; @@ -756,6 +757,10 @@ export type ModelWithEnum = { * These are the HTTP error code enums */ statusCode?: ModelWithEnum.statusCode; + /** + * Simple boolean enum + */ + bool?: boolean; } export namespace ModelWithEnum { @@ -1422,6 +1427,9 @@ export const $ModelWithEnum = { statusCode: { type: 'Enum', }, + bool: { + type: 'boolean', + }, }, };" `; @@ -1722,6 +1730,47 @@ export const $SimpleStringWithPattern = { };" `; +exports[`v2 should generate: ./test/generated/v2/services/CollectionFormatService.ts 1`] = ` +"/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import { request as __request } from '../core/request'; +import { OpenAPI } from '../core/OpenAPI'; + +export class CollectionFormatService { + + /** + * @param parameterArrayCsv This is an array parameter that is send as csv format (comma-separated values) + * @param parameterArraySsv This is an array parameter that is send as ssv format (space-separated values) + * @param parameterArrayTsv This is an array parameter that is send as tsv format (tab-separated values) + * @param parameterArrayMulti This is an array parameter that is send as pipes format (pipe-separated values) + * @param parameterArrayMulti This is an array parameter that is send as multi format (multiple parameter instances) + * @throws ApiError + */ + public static async collectionFormat( + parameterArrayCsv: Array, + parameterArraySsv: Array, + parameterArrayTsv: Array, + parameterArrayMulti: Array, + parameterArrayMulti: Array, + ): Promise { + const result = await __request({ + method: 'GET', + path: \`/api/v\${OpenAPI.VERSION}/collectionFormat\`, + query: { + 'parameterArrayCSV': parameterArrayCsv, + 'parameterArraySSV': parameterArraySsv, + 'parameterArrayTSV': parameterArrayTsv, + 'parameterArrayMulti': parameterArrayMulti, + 'parameterArrayMulti': parameterArrayMulti, + }, + }); + return result.body; + } + +}" +`; + exports[`v2 should generate: ./test/generated/v2/services/ComplexService.ts 1`] = ` "/* istanbul ignore file */ /* tslint:disable */ @@ -2639,6 +2688,7 @@ export { $SimpleReference } from './schemas/$SimpleReference'; export { $SimpleString } from './schemas/$SimpleString'; export { $SimpleStringWithPattern } from './schemas/$SimpleStringWithPattern'; +export { CollectionFormatService } from './services/CollectionFormatService'; export { ComplexService } from './services/ComplexService'; export { DefaultsService } from './services/DefaultsService'; export { DuplicateService } from './services/DuplicateService'; @@ -3136,6 +3186,10 @@ export type ModelWithEnum = { * These are the HTTP error code enums */ statusCode?: ModelWithEnum.statusCode; + /** + * Simple boolean enum + */ + bool?: boolean; } export namespace ModelWithEnum { @@ -3948,6 +4002,9 @@ export const $ModelWithEnum = { statusCode: { type: 'Enum', }, + bool: { + type: 'boolean', + }, }, };" `; @@ -4238,6 +4295,47 @@ export const $SimpleStringWithPattern = { };" `; +exports[`v3 should generate: ./test/generated/v3/services/CollectionFormatService.ts 1`] = ` +"/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import { request as __request } from '../core/request'; +import { OpenAPI } from '../core/OpenAPI'; + +export class CollectionFormatService { + + /** + * @param parameterArrayCsv This is an array parameter that is send as csv format (comma-separated values) + * @param parameterArraySsv This is an array parameter that is send as ssv format (space-separated values) + * @param parameterArrayTsv This is an array parameter that is send as tsv format (tab-separated values) + * @param parameterArrayMulti This is an array parameter that is send as pipes format (pipe-separated values) + * @param parameterArrayMulti This is an array parameter that is send as multi format (multiple parameter instances) + * @throws ApiError + */ + public static async collectionFormat( + parameterArrayCsv: Array | null, + parameterArraySsv: Array | null, + parameterArrayTsv: Array | null, + parameterArrayMulti: Array | null, + parameterArrayMulti: Array | null, + ): Promise { + const result = await __request({ + method: 'GET', + path: \`/api/v\${OpenAPI.VERSION}/collectionFormat\`, + query: { + 'parameterArrayCSV': parameterArrayCsv, + 'parameterArraySSV': parameterArraySsv, + 'parameterArrayTSV': parameterArrayTsv, + 'parameterArrayMulti': parameterArrayMulti, + 'parameterArrayMulti': parameterArrayMulti, + }, + }); + return result.body; + } + +}" +`; + exports[`v3 should generate: ./test/generated/v3/services/ComplexService.ts 1`] = ` "/* istanbul ignore file */ /* tslint:disable */