fork of hey-api/openapi-ts because I need some additional things

Merge pull request #907 from hey-api/fix/camelcase-dot-name

fix: camelcase dot name

authored by

Lubos and committed by
GitHub
54251773 cd25f5d3

+2476 -874
+5
.changeset/plenty-weeks-rush.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: correctly transform string to pascalcase when referenced inside schema
-1
packages/openapi-ts/package.json
··· 62 62 "dependencies": { 63 63 "@apidevtools/json-schema-ref-parser": "11.7.0", 64 64 "c12": "1.11.1", 65 - "camelcase": "8.0.0", 66 65 "commander": "12.1.0", 67 66 "handlebars": "4.7.8" 68 67 },
+13 -5
packages/openapi-ts/src/generate/services.ts
··· 1 - import camelcase from 'camelcase'; 2 - 3 1 import { 4 2 ClassElement, 5 3 type Comments, ··· 13 11 import { isOperationParameterRequired } from '../openApi/common/parser/operation'; 14 12 import type { Client } from '../types/client'; 15 13 import type { Files } from '../types/utils'; 14 + import { camelCase } from '../utils/camelCase'; 16 15 import { getConfig, isStandaloneClient } from '../utils/config'; 17 16 import { escapeComment, escapeName } from '../utils/escape'; 18 17 import { reservedWordsRegExp } from '../utils/reservedWords'; ··· 56 55 `${name}ModelResponseTransformer`; 57 56 58 57 export const operationDataTypeName = (name: string) => 59 - `${camelcase(name, { pascalCase: true })}Data`; 58 + `${camelCase({ 59 + input: name, 60 + pascalCase: true, 61 + })}Data`; 60 62 61 63 export const operationErrorTypeName = (name: string) => 62 - `${camelcase(name, { pascalCase: true })}Error`; 64 + `${camelCase({ 65 + input: name, 66 + pascalCase: true, 67 + })}Error`; 63 68 64 69 // operation response type ends with "Response", it's enough to append "Transformer" 65 70 export const operationResponseTransformerTypeName = (name: string) => 66 71 `${name}Transformer`; 67 72 68 73 export const operationResponseTypeName = (name: string) => 69 - `${camelcase(name, { pascalCase: true })}Response`; 74 + `${camelCase({ 75 + input: name, 76 + pascalCase: true, 77 + })}Response`; 70 78 71 79 /** 72 80 * @param importedType unique type name returned from `setUniqueTypeName()`
+7 -4
packages/openapi-ts/src/openApi/common/parser/operation.ts
··· 1 - import camelCase from 'camelcase'; 2 - 1 + import { camelCase } from '../../../utils/camelCase'; 3 2 import { getConfig, isStandaloneClient } from '../../../utils/config'; 4 3 import type { 5 4 OperationParameter, ··· 20 19 const config = getConfig(); 21 20 22 21 if (config.services.operationId && operationId) { 23 - return camelCase(sanitizeNamespaceIdentifier(operationId).trim()); 22 + return camelCase({ 23 + input: sanitizeNamespaceIdentifier(operationId), 24 + }); 24 25 } 25 26 26 27 let urlWithoutPlaceholders = url; ··· 39 40 // replace slashes with hyphens for camelcase method at the end 40 41 .replace(/\//g, '-'); 41 42 42 - return camelCase(`${method}-${urlWithoutPlaceholders}`); 43 + return camelCase({ 44 + input: `${method}-${urlWithoutPlaceholders}`, 45 + }); 43 46 }; 44 47 45 48 export const getOperationResponseHeader = (
+6 -6
packages/openapi-ts/src/openApi/common/parser/service.ts
··· 1 - import camelCase from 'camelcase'; 2 - 1 + import { camelCase } from '../../../utils/camelCase'; 3 2 import type { Operation, Service } from '../interfaces/client'; 4 3 import { sanitizeNamespaceIdentifier } from './sanitize'; 5 4 ··· 35 34 * Convert the input value to a correct service name. This converts 36 35 * the input string to PascalCase. 37 36 */ 38 - export const getServiceName = (value: string): string => { 39 - const clean = sanitizeNamespaceIdentifier(value).trim(); 40 - return camelCase(clean, { pascalCase: true }); 41 - }; 37 + export const getServiceName = (value: string): string => 38 + camelCase({ 39 + input: sanitizeNamespaceIdentifier(value), 40 + pascalCase: true, 41 + });
+4 -4
packages/openapi-ts/src/openApi/common/parser/type.ts
··· 1 - import camelcase from 'camelcase'; 2 - 1 + import { camelCase } from '../../../utils/camelCase'; 3 2 import { getConfig, isStandaloneClient } from '../../../utils/config'; 4 3 import { refParametersPartial } from '../../../utils/const'; 5 4 import { reservedWordsRegExp } from '../../../utils/reservedWords'; ··· 172 171 return value; 173 172 } 174 173 175 - const clean = sanitizeOperationParameterName(value).trim(); 176 - const name = camelcase(clean).replace(reservedWordsRegExp, '_$1'); 174 + const name = camelCase({ 175 + input: sanitizeOperationParameterName(value), 176 + }).replace(reservedWordsRegExp, '_$1'); 177 177 return name; 178 178 };
+111
packages/openapi-ts/src/utils/camelCase.ts
··· 1 + const UPPERCASE = /[\p{Lu}]/u; 2 + const LOWERCASE = /[\p{Ll}]/u; 3 + const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u; 4 + const SEPARATORS = /[_.\- ]+/; 5 + 6 + const LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source); 7 + const SEPARATORS_AND_IDENTIFIER = new RegExp( 8 + SEPARATORS.source + IDENTIFIER.source, 9 + 'gu', 10 + ); 11 + const NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu'); 12 + 13 + const preserveCamelCase = (string: string) => { 14 + let isLastCharLower = false; 15 + let isLastCharUpper = false; 16 + let isLastLastCharUpper = false; 17 + let isLastLastCharPreserved = false; 18 + 19 + for (let index = 0; index < string.length; index++) { 20 + const character = string[index]; 21 + isLastLastCharPreserved = index > 2 ? string[index - 3] === '-' : true; 22 + 23 + if (isLastCharLower && UPPERCASE.test(character)) { 24 + string = string.slice(0, index) + '-' + string.slice(index); 25 + isLastCharLower = false; 26 + isLastLastCharUpper = isLastCharUpper; 27 + isLastCharUpper = true; 28 + index++; 29 + } else if ( 30 + isLastCharUpper && 31 + isLastLastCharUpper && 32 + LOWERCASE.test(character) && 33 + !isLastLastCharPreserved 34 + ) { 35 + string = string.slice(0, index - 1) + '-' + string.slice(index - 1); 36 + isLastLastCharUpper = isLastCharUpper; 37 + isLastCharUpper = false; 38 + isLastCharLower = true; 39 + } else { 40 + isLastCharLower = 41 + character.toLocaleLowerCase() === character && 42 + character.toLocaleUpperCase() !== character; 43 + isLastLastCharUpper = isLastCharUpper; 44 + isLastCharUpper = 45 + character.toLocaleUpperCase() === character && 46 + character.toLocaleLowerCase() !== character; 47 + } 48 + } 49 + 50 + return string; 51 + }; 52 + 53 + /** 54 + * Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. Correctly handles Unicode strings. Returns transformed string. 55 + */ 56 + export const camelCase = ({ 57 + input, 58 + pascalCase, 59 + }: { 60 + input: string; 61 + /** 62 + * Uppercase the first character: `foo-bar` → `FooBar` 63 + * 64 + * @default false 65 + */ 66 + readonly pascalCase?: boolean; 67 + }): string => { 68 + let result = input.trim(); 69 + 70 + if (!result.length) { 71 + return ''; 72 + } 73 + 74 + if (result.length === 1) { 75 + if (SEPARATORS.test(result)) { 76 + return ''; 77 + } 78 + 79 + return pascalCase ? result.toLocaleUpperCase() : result.toLocaleLowerCase(); 80 + } 81 + 82 + const hasUpperCase = result !== result.toLocaleLowerCase(); 83 + 84 + if (hasUpperCase) { 85 + result = preserveCamelCase(result); 86 + } 87 + 88 + result = result.replace(LEADING_SEPARATORS, ''); 89 + result = result.toLocaleLowerCase(); 90 + 91 + if (pascalCase) { 92 + result = result.charAt(0).toLocaleUpperCase() + result.slice(1); 93 + } 94 + 95 + SEPARATORS_AND_IDENTIFIER.lastIndex = 0; 96 + NUMBERS_AND_IDENTIFIER.lastIndex = 0; 97 + 98 + result = result.replaceAll(NUMBERS_AND_IDENTIFIER, (match, _, offset) => { 99 + if (['_', '-', '.'].includes(result.charAt(offset + match.length))) { 100 + return match; 101 + } 102 + 103 + return match.toLocaleUpperCase(); 104 + }); 105 + 106 + result = result.replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => 107 + identifier.toLocaleUpperCase(), 108 + ); 109 + 110 + return result; 111 + };
+9 -2
packages/openapi-ts/src/utils/handlebars.ts
··· 1 - import camelCase from 'camelcase'; 2 1 import Handlebars from 'handlebars/runtime'; 3 2 4 3 import templateClient from '../templates/client.hbs'; ··· 45 44 import xhrGetResponseHeader from '../templates/core/xhr/getResponseHeader.hbs'; 46 45 import xhrRequest from '../templates/core/xhr/request.hbs'; 47 46 import xhrSendRequest from '../templates/core/xhr/sendRequest.hbs'; 47 + import { camelCase } from './camelCase'; 48 48 import { transformServiceName } from './transform'; 49 49 50 50 export const registerHandlebarHelpers = (): void => { 51 - Handlebars.registerHelper('camelCase', camelCase); 51 + Handlebars.registerHelper( 52 + 'camelCase', 53 + function (this: unknown, name: string) { 54 + return camelCase({ 55 + input: name, 56 + }); 57 + }, 58 + ); 52 59 53 60 Handlebars.registerHelper( 54 61 'equals',
+5 -3
packages/openapi-ts/src/utils/transform.ts
··· 1 - import camelcase from 'camelcase'; 2 - 3 1 import { ensureValidTypeScriptJavaScriptIdentifier } from '../openApi/common/parser/sanitize'; 2 + import { camelCase } from './camelCase'; 4 3 import { getConfig } from './config'; 5 4 import { reservedWordsRegExp } from './reservedWords'; 6 5 ··· 15 14 export const transformTypeName = (name: string) => { 16 15 const config = getConfig(); 17 16 if (config.types.name === 'PascalCase') { 18 - return camelcase(name, { pascalCase: true }); 17 + return camelCase({ 18 + input: name, 19 + pascalCase: true, 20 + }); 19 21 } 20 22 return name; 21 23 };
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+25
packages/openapi-ts/test/__snapshots__/test/generated/v3-schemas-form/schemas.gen.ts.snap
··· 1678 1678 ] 1679 1679 } 1680 1680 } 1681 + } as const; 1682 + 1683 + export const $io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1684 + properties: { 1685 + preconditions: { 1686 + allOf: [ 1687 + { 1688 + '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' 1689 + } 1690 + ] 1691 + } 1692 + }, 1693 + type: 'object' 1694 + } as const; 1695 + 1696 + export const $io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1697 + properties: { 1698 + resourceVersion: { 1699 + type: 'string' 1700 + }, 1701 + uid: { 1702 + type: 'string' 1703 + } 1704 + }, 1705 + type: 'object' 1681 1706 } as const;
+30
packages/openapi-ts/test/__snapshots__/test/generated/v3-schemas-json/schemas.gen.ts.snap
··· 1833 1833 ] 1834 1834 } 1835 1835 } 1836 + } as const; 1837 + 1838 + export const $io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1839 + description: 'This schema was giving PascalCase transformations a hard time', 1840 + properties: { 1841 + preconditions: { 1842 + allOf: [ 1843 + { 1844 + '$ref': '#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions' 1845 + } 1846 + ], 1847 + description: 'Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.' 1848 + } 1849 + }, 1850 + type: 'object' 1851 + } as const; 1852 + 1853 + export const $io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1854 + description: 'This schema was giving PascalCase transformations a hard time', 1855 + properties: { 1856 + resourceVersion: { 1857 + description: 'Specifies the target ResourceVersion', 1858 + type: 'string' 1859 + }, 1860 + uid: { 1861 + description: 'Specifies the target UID.', 1862 + type: 'string' 1863 + } 1864 + }, 1865 + type: 'object' 1836 1866 } as const;
+1725
packages/openapi-ts/test/__snapshots__/test/generated/v3-types-PascalCase/types.gen.ts.snap
··· 1 + // This file is auto-generated by @hey-api/openapi-ts 2 + 3 + /** 4 + * Model with number-only name 5 + */ 6 + export type _400 = string; 7 + 8 + /** 9 + * Testing multiline comments in string: First line 10 + * Second line 11 + * 12 + * Fourth line 13 + */ 14 + export type CamelCaseCommentWithBreaks = number; 15 + 16 + /** 17 + * Testing multiline comments in string: First line 18 + * Second line 19 + * 20 + * Fourth line 21 + */ 22 + export type CommentWithBreaks = number; 23 + 24 + /** 25 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 26 + */ 27 + export type CommentWithBackticks = number; 28 + 29 + /** 30 + * Testing backticks and quotes in string: `backticks`, 'quotes', "double quotes" and ```multiple backticks``` should work 31 + */ 32 + export type CommentWithBackticksAndQuotes = number; 33 + 34 + /** 35 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 36 + */ 37 + export type CommentWithSlashes = number; 38 + 39 + /** 40 + * Testing expression placeholders in string: ${expression} should work 41 + */ 42 + export type CommentWithExpressionPlaceholders = number; 43 + 44 + /** 45 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 46 + */ 47 + export type CommentWithQuotes = number; 48 + 49 + /** 50 + * Testing reserved characters in string: * inline * and ** inline ** should work 51 + */ 52 + export type CommentWithReservedCharacters = number; 53 + 54 + /** 55 + * This is a simple number 56 + */ 57 + export type SimpleInteger = number; 58 + 59 + /** 60 + * This is a simple boolean 61 + */ 62 + export type SimpleBoolean = boolean; 63 + 64 + /** 65 + * This is a simple string 66 + */ 67 + export type SimpleString = string; 68 + 69 + /** 70 + * A string with non-ascii (unicode) characters valid in typescript identifiers (æøåÆØÅöÔèÈ字符串) 71 + */ 72 + export type NonAsciiStringæøåÆøÅöôêÊ字符串 = string; 73 + 74 + /** 75 + * This is a simple file 76 + */ 77 + export type SimpleFile = (Blob | File); 78 + 79 + /** 80 + * This is a simple reference 81 + */ 82 + export type SimpleReference = ModelWithString; 83 + 84 + /** 85 + * This is a simple string 86 + */ 87 + export type SimpleStringWithPattern = string | null; 88 + 89 + /** 90 + * This is a simple enum with strings 91 + */ 92 + export type EnumWithStrings = 'Success' | 'Warning' | 'Error' | "'Single Quote'" | '"Double Quotes"' | 'Non-ascii: øæåôöØÆÅÔÖ字符串'; 93 + 94 + export type EnumWithReplacedCharacters = "'Single Quote'" | '"Double Quotes"' | 'øæåôöØÆÅÔÖ字符串' | 3.1 | ''; 95 + 96 + /** 97 + * This is a simple enum with numbers 98 + */ 99 + export type EnumWithNumbers = 1 | 2 | 3 | 1.1 | 1.2 | 1.3 | 100 | 200 | 300 | -100 | -200 | -300 | -1.1 | -1.2 | -1.3; 100 + 101 + /** 102 + * Success=1,Warning=2,Error=3 103 + */ 104 + export type EnumFromDescription = number; 105 + 106 + /** 107 + * This is a simple enum with numbers 108 + */ 109 + export type EnumWithExtensions = 200 | 400 | 500; 110 + 111 + export type EnumWithXenumNames = 0 | 1 | 2; 112 + 113 + /** 114 + * This is a simple array with numbers 115 + */ 116 + export type ArrayWithNumbers = Array<(number)>; 117 + 118 + /** 119 + * This is a simple array with booleans 120 + */ 121 + export type ArrayWithBooleans = Array<(boolean)>; 122 + 123 + /** 124 + * This is a simple array with strings 125 + */ 126 + export type ArrayWithStrings = Array<(string)>; 127 + 128 + /** 129 + * This is a simple array with references 130 + */ 131 + export type ArrayWithReferences = Array<ModelWithString>; 132 + 133 + /** 134 + * This is a simple array containing an array 135 + */ 136 + export type ArrayWithArray = Array<Array<ModelWithString>>; 137 + 138 + /** 139 + * This is a simple array with properties 140 + */ 141 + export type ArrayWithProperties = Array<{ 142 + '16x16'?: CamelCaseCommentWithBreaks; 143 + bar?: string; 144 + }>; 145 + 146 + /** 147 + * This is a simple array with any of properties 148 + */ 149 + export type ArrayWithAnyOfProperties = Array<({ 150 + foo?: string; 151 + } | { 152 + bar?: string; 153 + })>; 154 + 155 + export type AnyOfAnyAndNull = { 156 + data?: unknown | null; 157 + }; 158 + 159 + /** 160 + * This is a simple array with any of properties 161 + */ 162 + export type AnyOfArrays = { 163 + results?: Array<({ 164 + foo?: string; 165 + } | { 166 + bar?: string; 167 + })>; 168 + }; 169 + 170 + /** 171 + * This is a string dictionary 172 + */ 173 + export type DictionaryWithString = { 174 + [key: string]: (string); 175 + }; 176 + 177 + export type DictionaryWithPropertiesAndAdditionalProperties = { 178 + foo?: number; 179 + bar?: boolean; 180 + [key: string]: (string | number | boolean) | undefined; 181 + }; 182 + 183 + /** 184 + * This is a string reference 185 + */ 186 + export type DictionaryWithReference = { 187 + [key: string]: ModelWithString; 188 + }; 189 + 190 + /** 191 + * This is a complex dictionary 192 + */ 193 + export type DictionaryWithArray = { 194 + [key: string]: Array<ModelWithString>; 195 + }; 196 + 197 + /** 198 + * This is a string dictionary 199 + */ 200 + export type DictionaryWithDictionary = { 201 + [key: string]: { 202 + [key: string]: (string); 203 + }; 204 + }; 205 + 206 + /** 207 + * This is a complex dictionary 208 + */ 209 + export type DictionaryWithProperties = { 210 + [key: string]: { 211 + foo?: string; 212 + bar?: string; 213 + }; 214 + }; 215 + 216 + /** 217 + * This is a model with one number property 218 + */ 219 + export type ModelWithInteger = { 220 + /** 221 + * This is a simple number property 222 + */ 223 + prop?: number; 224 + }; 225 + 226 + /** 227 + * This is a model with one boolean property 228 + */ 229 + export type ModelWithBoolean = { 230 + /** 231 + * This is a simple boolean property 232 + */ 233 + prop?: boolean; 234 + }; 235 + 236 + /** 237 + * This is a model with one string property 238 + */ 239 + export type ModelWithString = { 240 + /** 241 + * This is a simple string property 242 + */ 243 + prop?: string; 244 + }; 245 + 246 + /** 247 + * This is a model with one string property 248 + */ 249 + export type ModelWithStringError = { 250 + /** 251 + * This is a simple string property 252 + */ 253 + prop?: string; 254 + }; 255 + 256 + /** 257 + * `Comment` or `VoiceComment`. The JSON object for adding voice comments to tickets is different. See [Adding voice comments to tickets](/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets) 258 + */ 259 + export type ModelFromZendesk = string; 260 + 261 + /** 262 + * This is a model with one string property 263 + */ 264 + export type ModelWithNullableString = { 265 + /** 266 + * This is a simple string property 267 + */ 268 + nullableProp1?: string | null; 269 + /** 270 + * This is a simple string property 271 + */ 272 + nullableRequiredProp1: string | null; 273 + /** 274 + * This is a simple string property 275 + */ 276 + nullableProp2?: string | null; 277 + /** 278 + * This is a simple string property 279 + */ 280 + nullableRequiredProp2: string | null; 281 + /** 282 + * This is a simple enum with strings 283 + */ 284 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 285 + }; 286 + 287 + /** 288 + * This is a simple enum with strings 289 + */ 290 + export type foo_bar_enum = 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 291 + 292 + /** 293 + * This is a model with one enum 294 + */ 295 + export type ModelWithEnum = { 296 + /** 297 + * This is a simple enum with strings 298 + */ 299 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 300 + /** 301 + * These are the HTTP error code enums 302 + */ 303 + statusCode?: '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 304 + /** 305 + * Simple boolean enum 306 + */ 307 + bool?: boolean; 308 + }; 309 + 310 + /** 311 + * These are the HTTP error code enums 312 + */ 313 + export type statusCode = '100' | '200 FOO' | '300 FOO_BAR' | '400 foo-bar' | '500 foo.bar' | '600 foo&bar'; 314 + 315 + /** 316 + * This is a model with one enum with escaped name 317 + */ 318 + export type ModelWithEnumWithHyphen = { 319 + 'foo-bar-baz-qux'?: '3.0'; 320 + }; 321 + 322 + export type foo_bar_baz_qux = '3.0'; 323 + 324 + /** 325 + * This is a model with one enum 326 + */ 327 + export type ModelWithEnumFromDescription = { 328 + /** 329 + * Success=1,Warning=2,Error=3 330 + */ 331 + test?: number; 332 + }; 333 + 334 + /** 335 + * This is a model with nested enums 336 + */ 337 + export type ModelWithNestedEnums = { 338 + dictionaryWithEnum?: { 339 + [key: string]: ('Success' | 'Warning' | 'Error'); 340 + }; 341 + dictionaryWithEnumFromDescription?: { 342 + [key: string]: (number); 343 + }; 344 + arrayWithEnum?: Array<('Success' | 'Warning' | 'Error')>; 345 + arrayWithDescription?: Array<(number)>; 346 + /** 347 + * This is a simple enum with strings 348 + */ 349 + 'foo_bar-enum'?: 'Success' | 'Warning' | 'Error' | 'ØÆÅ字符串'; 350 + }; 351 + 352 + /** 353 + * This is a model with one property containing a reference 354 + */ 355 + export type ModelWithReference = { 356 + prop?: ModelWithProperties; 357 + }; 358 + 359 + /** 360 + * This is a model with one property containing an array 361 + */ 362 + export type ModelWithArrayReadOnlyAndWriteOnly = { 363 + prop?: Array<ModelWithReadOnlyAndWriteOnly>; 364 + propWithFile?: Array<((Blob | File))>; 365 + propWithNumber?: Array<(number)>; 366 + }; 367 + 368 + /** 369 + * This is a model with one property containing an array 370 + */ 371 + export type ModelWithArray = { 372 + prop?: Array<ModelWithString>; 373 + propWithFile?: Array<((Blob | File))>; 374 + propWithNumber?: Array<(number)>; 375 + }; 376 + 377 + /** 378 + * This is a model with one property containing a dictionary 379 + */ 380 + export type ModelWithDictionary = { 381 + prop?: { 382 + [key: string]: (string); 383 + }; 384 + }; 385 + 386 + /** 387 + * This is a deprecated model with a deprecated property 388 + * @deprecated 389 + */ 390 + export type DeprecatedModel = { 391 + /** 392 + * This is a deprecated property 393 + * @deprecated 394 + */ 395 + prop?: string; 396 + }; 397 + 398 + /** 399 + * This is a model with one property containing a circular reference 400 + */ 401 + export type ModelWithCircularReference = { 402 + prop?: ModelWithCircularReference; 403 + }; 404 + 405 + /** 406 + * This is a model with one property with a 'one of' relationship 407 + */ 408 + export type CompositionWithOneOf = { 409 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 410 + }; 411 + 412 + /** 413 + * This is a model with one property with a 'one of' relationship where the options are not $ref 414 + */ 415 + export type CompositionWithOneOfAnonymous = { 416 + propA?: { 417 + propA?: string; 418 + } | string | number; 419 + }; 420 + 421 + /** 422 + * Circle 423 + */ 424 + export type ModelCircle = { 425 + kind: 'circle'; 426 + radius?: number; 427 + }; 428 + 429 + /** 430 + * Square 431 + */ 432 + export type ModelSquare = { 433 + kind: 'square'; 434 + sideLength?: number; 435 + }; 436 + 437 + /** 438 + * This is a model with one property with a 'one of' relationship where the options are not $ref 439 + */ 440 + export type CompositionWithOneOfDiscriminator = ModelCircle | ModelSquare; 441 + 442 + /** 443 + * This is a model with one property with a 'any of' relationship 444 + */ 445 + export type CompositionWithAnyOf = { 446 + propA?: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 447 + }; 448 + 449 + /** 450 + * This is a model with one property with a 'any of' relationship where the options are not $ref 451 + */ 452 + export type CompositionWithAnyOfAnonymous = { 453 + propA?: { 454 + propA?: string; 455 + } | string | number; 456 + }; 457 + 458 + /** 459 + * This is a model with nested 'any of' property with a type null 460 + */ 461 + export type CompositionWithNestedAnyAndTypeNull = { 462 + propA?: Array<(ModelWithDictionary | null)> | Array<(ModelWithArray | null)>; 463 + }; 464 + 465 + export type _3eNum1Период = 'Bird' | 'Dog'; 466 + 467 + export type ConstValue = "ConstValue"; 468 + 469 + /** 470 + * This is a model with one property with a 'any of' relationship where the options are not $ref 471 + */ 472 + export type CompositionWithNestedAnyOfAndNull = { 473 + propA?: Array<(_3eNum1Период | ConstValue)> | null; 474 + }; 475 + 476 + /** 477 + * This is a model with one property with a 'one of' relationship 478 + */ 479 + export type CompositionWithOneOfAndNullable = { 480 + propA?: { 481 + boolean?: boolean; 482 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 483 + }; 484 + 485 + /** 486 + * This is a model that contains a simple dictionary within composition 487 + */ 488 + export type CompositionWithOneOfAndSimpleDictionary = { 489 + propA?: boolean | { 490 + [key: string]: (number); 491 + }; 492 + }; 493 + 494 + /** 495 + * This is a model that contains a dictionary of simple arrays within composition 496 + */ 497 + export type CompositionWithOneOfAndSimpleArrayDictionary = { 498 + propA?: boolean | { 499 + [key: string]: Array<(boolean)>; 500 + }; 501 + }; 502 + 503 + /** 504 + * This is a model that contains a dictionary of complex arrays (composited) within composition 505 + */ 506 + export type CompositionWithOneOfAndComplexArrayDictionary = { 507 + propA?: boolean | { 508 + [key: string]: Array<(number | string)>; 509 + }; 510 + }; 511 + 512 + /** 513 + * This is a model with one property with a 'all of' relationship 514 + */ 515 + export type CompositionWithAllOfAndNullable = { 516 + propA?: ({ 517 + boolean?: boolean; 518 + } & ModelWithEnum & ModelWithArray & ModelWithDictionary) | null; 519 + }; 520 + 521 + /** 522 + * This is a model with one property with a 'any of' relationship 523 + */ 524 + export type CompositionWithAnyOfAndNullable = { 525 + propA?: { 526 + boolean?: boolean; 527 + } | ModelWithEnum | ModelWithArray | ModelWithDictionary | null; 528 + }; 529 + 530 + /** 531 + * This is a base model with two simple optional properties 532 + */ 533 + export type CompositionBaseModel = { 534 + firstName?: string; 535 + lastname?: string; 536 + }; 537 + 538 + /** 539 + * This is a model that extends the base model 540 + */ 541 + export type CompositionExtendedModel = CompositionBaseModel & { 542 + firstName: string; 543 + lastname: string; 544 + age: number; 545 + }; 546 + 547 + /** 548 + * This is a model with one nested property 549 + */ 550 + export type ModelWithProperties = { 551 + required: string; 552 + readonly requiredAndReadOnly: string; 553 + requiredAndNullable: string | null; 554 + string?: string; 555 + number?: number; 556 + boolean?: boolean; 557 + reference?: ModelWithString; 558 + 'property with space'?: string; 559 + default?: string; 560 + try?: string; 561 + readonly '@namespace.string'?: string; 562 + readonly '@namespace.integer'?: number; 563 + }; 564 + 565 + /** 566 + * This is a model with one nested property 567 + */ 568 + export type ModelWithNestedProperties = { 569 + readonly first: { 570 + readonly second: { 571 + readonly third: string | null; 572 + } | null; 573 + } | null; 574 + }; 575 + 576 + /** 577 + * This is a model with duplicated properties 578 + */ 579 + export type ModelWithDuplicateProperties = { 580 + prop?: ModelWithString; 581 + }; 582 + 583 + /** 584 + * This is a model with ordered properties 585 + */ 586 + export type ModelWithOrderedProperties = { 587 + zebra?: string; 588 + apple?: string; 589 + hawaii?: string; 590 + }; 591 + 592 + /** 593 + * This is a model with duplicated imports 594 + */ 595 + export type ModelWithDuplicateImports = { 596 + propA?: ModelWithString; 597 + propB?: ModelWithString; 598 + propC?: ModelWithString; 599 + }; 600 + 601 + /** 602 + * This is a model that extends another model 603 + */ 604 + export type ModelThatExtends = ModelWithString & { 605 + propExtendsA?: string; 606 + propExtendsB?: ModelWithString; 607 + }; 608 + 609 + /** 610 + * This is a model that extends another model 611 + */ 612 + export type ModelThatExtendsExtends = ModelWithString & ModelThatExtends & { 613 + propExtendsC?: string; 614 + propExtendsD?: ModelWithString; 615 + }; 616 + 617 + /** 618 + * This is a model that contains a some patterns 619 + */ 620 + export type ModelWithPattern = { 621 + key: string; 622 + name: string; 623 + readonly enabled?: boolean; 624 + readonly modified?: string; 625 + id?: string; 626 + text?: string; 627 + patternWithSingleQuotes?: string; 628 + patternWithNewline?: string; 629 + patternWithBacktick?: string; 630 + }; 631 + 632 + export type File = { 633 + readonly id?: string; 634 + readonly updated_at?: string; 635 + readonly created_at?: string; 636 + mime: string; 637 + readonly file?: string; 638 + }; 639 + 640 + export type Default = { 641 + name?: string; 642 + }; 643 + 644 + export type Pageable = { 645 + page?: number; 646 + size?: number; 647 + sort?: Array<(string)>; 648 + }; 649 + 650 + /** 651 + * This is a free-form object without additionalProperties. 652 + */ 653 + export type FreeFormObjectWithoutAdditionalProperties = { 654 + [key: string]: unknown; 655 + }; 656 + 657 + /** 658 + * This is a free-form object with additionalProperties: true. 659 + */ 660 + export type FreeFormObjectWithAdditionalPropertiesEqTrue = { 661 + [key: string]: unknown; 662 + }; 663 + 664 + /** 665 + * This is a free-form object with additionalProperties: {}. 666 + */ 667 + export type FreeFormObjectWithAdditionalPropertiesEqEmptyObject = { 668 + [key: string]: unknown; 669 + }; 670 + 671 + export type ModelWithConst = { 672 + String?: "String"; 673 + number?: 0; 674 + null?: null; 675 + withType?: "Some string"; 676 + }; 677 + 678 + /** 679 + * This is a model with one property and additionalProperties: true 680 + */ 681 + export type ModelWithAdditionalPropertiesEqTrue = { 682 + /** 683 + * This is a simple string property 684 + */ 685 + prop?: string; 686 + [key: string]: unknown | string; 687 + }; 688 + 689 + export type NestedAnyOfArraysNullable = { 690 + nullableArray?: Array<(string | boolean)> | null; 691 + }; 692 + 693 + export type CompositionWithOneOfAndProperties = { 694 + foo: ParameterSimpleParameter; 695 + } | { 696 + bar: NonAsciiStringæøåÆøÅöôêÊ字符串; 697 + } & { 698 + baz: number | null; 699 + qux: number; 700 + }; 701 + 702 + /** 703 + * An object that can be null 704 + */ 705 + export type NullableObject = { 706 + foo?: string; 707 + } | null; 708 + 709 + /** 710 + * Some % character 711 + */ 712 + export type CharactersInDescription = string; 713 + 714 + export type ModelWithNullableObject = { 715 + data?: NullableObject; 716 + }; 717 + 718 + export type ModelWithOneOfEnum = { 719 + foo: 'Bar'; 720 + } | { 721 + foo: 'Baz'; 722 + } | { 723 + foo: 'Qux'; 724 + } | { 725 + content: string; 726 + foo: 'Quux'; 727 + } | { 728 + content: [ 729 + string, 730 + string 731 + ]; 732 + foo: 'Corge'; 733 + }; 734 + 735 + export type foo = 'Bar'; 736 + 737 + export type ModelWithNestedArrayEnumsDataFoo = 'foo' | 'bar'; 738 + 739 + export type ModelWithNestedArrayEnumsDataBar = 'baz' | 'qux'; 740 + 741 + export type ModelWithNestedArrayEnumsData = { 742 + foo?: Array<ModelWithNestedArrayEnumsDataFoo>; 743 + bar?: Array<ModelWithNestedArrayEnumsDataBar>; 744 + }; 745 + 746 + export type ModelWithNestedArrayEnums = { 747 + array_strings?: Array<(string)>; 748 + data?: ModelWithNestedArrayEnumsData; 749 + }; 750 + 751 + export type ModelWithNestedCompositionEnums = { 752 + foo?: ModelWithNestedArrayEnumsDataFoo; 753 + }; 754 + 755 + export type ModelWithReadOnlyAndWriteOnly = { 756 + foo: string; 757 + readonly bar: string; 758 + baz: string; 759 + }; 760 + 761 + export type ModelWithConstantSizeArray = [ 762 + number, 763 + number 764 + ]; 765 + 766 + export type ModelWithAnyOfConstantSizeArray = [ 767 + number | string, 768 + number | string, 769 + number | string 770 + ]; 771 + 772 + export type ModelWithPrefixItemsConstantSizeArray = [ 773 + ModelWithInteger, 774 + number | string, 775 + string 776 + ]; 777 + 778 + export type ModelWithAnyOfConstantSizeArrayNullable = [ 779 + number | null | string, 780 + number | null | string, 781 + number | null | string 782 + ]; 783 + 784 + export type ModelWithAnyOfConstantSizeArrayWithNsizeAndOptions = [ 785 + number | Import, 786 + number | Import 787 + ]; 788 + 789 + export type ModelWithAnyOfConstantSizeArrayAndIntersect = [ 790 + number & string, 791 + number & string 792 + ]; 793 + 794 + export type ModelWithNumericEnumUnion = { 795 + /** 796 + * Период 797 + */ 798 + value?: -10 | -1 | 0 | 1 | 3 | 6 | 12; 799 + }; 800 + 801 + /** 802 + * Период 803 + */ 804 + export type value = -10 | -1 | 0 | 1 | 3 | 6 | 12; 805 + 806 + /** 807 + * Some description with `back ticks` 808 + */ 809 + export type ModelWithBackticksInDescription = { 810 + /** 811 + * The template `that` should be used for parsing and importing the contents of the CSV file. 812 + * 813 + * <br/><p>There is one placeholder currently supported:<ul> <li><b>${x}</b> - refers to the n-th column in the CSV file, e.g. ${1}, ${2}, ...)</li></ul><p>Example of a correct JSON template:</p> 814 + * <pre> 815 + * [ 816 + * { 817 + * "resourceType": "Asset", 818 + * "identifier": { 819 + * "name": "${1}", 820 + * "domain": { 821 + * "name": "${2}", 822 + * "community": { 823 + * "name": "Some Community" 824 + * } 825 + * } 826 + * }, 827 + * "attributes" : { 828 + * "00000000-0000-0000-0000-000000003115" : [ { 829 + * "value" : "${3}" 830 + * } ], 831 + * "00000000-0000-0000-0000-000000000222" : [ { 832 + * "value" : "${4}" 833 + * } ] 834 + * } 835 + * } 836 + * ] 837 + * </pre> 838 + */ 839 + template?: string; 840 + }; 841 + 842 + export type ModelWithOneOfAndProperties = ParameterSimpleParameter | NonAsciiStringæøåÆøÅöôêÊ字符串 & { 843 + baz: number | null; 844 + qux: number; 845 + }; 846 + 847 + /** 848 + * Model used to test deduplication strategy (unused) 849 + */ 850 + export type ParameterSimpleParameterUnused = string; 851 + 852 + /** 853 + * Model used to test deduplication strategy 854 + */ 855 + export type PostServiceWithEmptyTagResponse = string; 856 + 857 + /** 858 + * Model used to test deduplication strategy 859 + */ 860 + export type PostServiceWithEmptyTagResponse2 = string; 861 + 862 + /** 863 + * Model used to test deduplication strategy 864 + */ 865 + export type DeleteFooData = string; 866 + 867 + /** 868 + * Model used to test deduplication strategy 869 + */ 870 + export type DeleteFooData2 = string; 871 + 872 + /** 873 + * Model with restricted keyword name 874 + */ 875 + export type Import = string; 876 + 877 + export type SchemaWithFormRestrictedKeys = { 878 + description?: string; 879 + 'x-enum-descriptions'?: string; 880 + 'x-enum-varnames'?: string; 881 + 'x-enumNames'?: string; 882 + title?: string; 883 + object?: { 884 + description?: string; 885 + 'x-enum-descriptions'?: string; 886 + 'x-enum-varnames'?: string; 887 + 'x-enumNames'?: string; 888 + title?: string; 889 + }; 890 + array?: Array<({ 891 + description?: string; 892 + 'x-enum-descriptions'?: string; 893 + 'x-enum-varnames'?: string; 894 + 'x-enumNames'?: string; 895 + title?: string; 896 + })>; 897 + }; 898 + 899 + /** 900 + * This schema was giving PascalCase transformations a hard time 901 + */ 902 + export type IoK8sApimachineryPkgApisMetaV1DeleteOptions = { 903 + /** 904 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 905 + */ 906 + preconditions?: IoK8sApimachineryPkgApisMetaV1Preconditions; 907 + }; 908 + 909 + /** 910 + * This schema was giving PascalCase transformations a hard time 911 + */ 912 + export type IoK8sApimachineryPkgApisMetaV1Preconditions = { 913 + /** 914 + * Specifies the target ResourceVersion 915 + */ 916 + resourceVersion?: string; 917 + /** 918 + * Specifies the target UID. 919 + */ 920 + uid?: string; 921 + }; 922 + 923 + /** 924 + * This is a reusable parameter 925 + */ 926 + export type ParameterSimpleParameter = string; 927 + 928 + /** 929 + * Parameter with illegal characters 930 + */ 931 + export type ParameterXFooBar = ModelWithString; 932 + 933 + export type ImportData = { 934 + requestBody: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; 935 + }; 936 + 937 + export type ImportResponse = ModelFromZendesk | ModelWithReadOnlyAndWriteOnly; 938 + 939 + export type ApiVversionOdataControllerCountResponse = ModelFromZendesk; 940 + 941 + export type DeleteFooData3 = { 942 + /** 943 + * bar in method 944 + */ 945 + barParam: string; 946 + /** 947 + * foo in method 948 + */ 949 + fooParam: string; 950 + /** 951 + * Parameter with illegal characters 952 + */ 953 + xFooBar: ModelWithString; 954 + }; 955 + 956 + export type CallWithDescriptionsData = { 957 + /** 958 + * Testing backticks in string: `backticks` and ```multiple backticks``` should work 959 + */ 960 + parameterWithBackticks?: unknown; 961 + /** 962 + * Testing multiline comments in string: First line 963 + * Second line 964 + * 965 + * Fourth line 966 + */ 967 + parameterWithBreaks?: unknown; 968 + /** 969 + * Testing expression placeholders in string: ${expression} should work 970 + */ 971 + parameterWithExpressionPlaceholders?: unknown; 972 + /** 973 + * Testing quotes in string: 'single quote''' and "double quotes""" should work 974 + */ 975 + parameterWithQuotes?: unknown; 976 + /** 977 + * Testing reserved characters in string: * inline * and ** inline ** should work 978 + */ 979 + parameterWithReservedCharacters?: unknown; 980 + /** 981 + * Testing slashes in string: \backwards\\\ and /forwards/// should work 982 + */ 983 + parameterWithSlashes?: unknown; 984 + }; 985 + 986 + export type DeprecatedCallData = { 987 + /** 988 + * This parameter is deprecated 989 + * @deprecated 990 + */ 991 + parameter: DeprecatedModel | null; 992 + }; 993 + 994 + export type CallWithParametersData = { 995 + /** 996 + * This is the parameter that goes into the query params 997 + */ 998 + cursor: string | null; 999 + fooAllOfEnum: ModelWithNestedArrayEnumsDataFoo; 1000 + fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; 1001 + /** 1002 + * This is the parameter that goes into the cookie 1003 + */ 1004 + parameterCookie: string | null; 1005 + /** 1006 + * This is the parameter that goes into the header 1007 + */ 1008 + parameterHeader: string | null; 1009 + /** 1010 + * This is the parameter that goes into the path 1011 + */ 1012 + parameterPath: string | null; 1013 + /** 1014 + * This is the parameter that goes into the body 1015 + */ 1016 + requestBody: { 1017 + [key: string]: unknown; 1018 + } | null; 1019 + }; 1020 + 1021 + export type CallWithWeirdParameterNamesData = { 1022 + /** 1023 + * This is the parameter with a reserved keyword 1024 + */ 1025 + _default?: string; 1026 + /** 1027 + * This is the parameter that goes into the cookie 1028 + */ 1029 + parameterCookie: string | null; 1030 + /** 1031 + * This is the parameter that goes into the request header 1032 + */ 1033 + parameterHeader: string | null; 1034 + /** 1035 + * This is the parameter that goes into the path 1036 + */ 1037 + parameterPath1?: string; 1038 + /** 1039 + * This is the parameter that goes into the path 1040 + */ 1041 + parameterPath2?: string; 1042 + /** 1043 + * This is the parameter that goes into the path 1044 + */ 1045 + parameterPath3?: string; 1046 + /** 1047 + * This is the parameter that goes into the request query params 1048 + */ 1049 + parameterQuery: string | null; 1050 + /** 1051 + * This is the parameter that goes into the body 1052 + */ 1053 + requestBody: ModelWithString | null; 1054 + }; 1055 + 1056 + export type GetCallWithOptionalParamData = { 1057 + /** 1058 + * This is an optional parameter 1059 + */ 1060 + page?: number; 1061 + /** 1062 + * This is a required parameter 1063 + */ 1064 + requestBody: ModelWithOneOfEnum; 1065 + }; 1066 + 1067 + export type PostCallWithOptionalParamData = { 1068 + /** 1069 + * This is a required parameter 1070 + */ 1071 + parameter: Pageable; 1072 + /** 1073 + * This is an optional parameter 1074 + */ 1075 + requestBody?: { 1076 + offset?: number | null; 1077 + }; 1078 + }; 1079 + 1080 + export type PostCallWithOptionalParamResponse = number | void; 1081 + 1082 + export type PostApiRequestBodyData = { 1083 + /** 1084 + * A reusable request body 1085 + */ 1086 + foo?: ModelWithString; 1087 + /** 1088 + * This is a reusable parameter 1089 + */ 1090 + parameter?: string; 1091 + }; 1092 + 1093 + export type PostApiFormDataData = { 1094 + /** 1095 + * A reusable request body 1096 + */ 1097 + formData?: ModelWithString; 1098 + /** 1099 + * This is a reusable parameter 1100 + */ 1101 + parameter?: string; 1102 + }; 1103 + 1104 + export type CallWithDefaultParametersData = { 1105 + /** 1106 + * This is a simple boolean with default value 1107 + */ 1108 + parameterBoolean?: boolean | null; 1109 + /** 1110 + * This is a simple enum with default value 1111 + */ 1112 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1113 + /** 1114 + * This is a simple model with default value 1115 + */ 1116 + parameterModel?: ModelWithString | null; 1117 + /** 1118 + * This is a simple number with default value 1119 + */ 1120 + parameterNumber?: number | null; 1121 + /** 1122 + * This is a simple string with default value 1123 + */ 1124 + parameterString?: string | null; 1125 + }; 1126 + 1127 + export type CallWithDefaultOptionalParametersData = { 1128 + /** 1129 + * This is a simple boolean that is optional with default value 1130 + */ 1131 + parameterBoolean?: boolean; 1132 + /** 1133 + * This is a simple enum that is optional with default value 1134 + */ 1135 + parameterEnum?: 'Success' | 'Warning' | 'Error'; 1136 + /** 1137 + * This is a simple model that is optional with default value 1138 + */ 1139 + parameterModel?: ModelWithString; 1140 + /** 1141 + * This is a simple number that is optional with default value 1142 + */ 1143 + parameterNumber?: number; 1144 + /** 1145 + * This is a simple string that is optional with default value 1146 + */ 1147 + parameterString?: string; 1148 + }; 1149 + 1150 + export type CallToTestOrderOfParamsData = { 1151 + /** 1152 + * This is a optional string with default 1153 + */ 1154 + parameterOptionalStringWithDefault?: string; 1155 + /** 1156 + * This is a optional string with empty default 1157 + */ 1158 + parameterOptionalStringWithEmptyDefault?: string; 1159 + /** 1160 + * This is a optional string with no default 1161 + */ 1162 + parameterOptionalStringWithNoDefault?: string; 1163 + /** 1164 + * This is a string that can be null with default 1165 + */ 1166 + parameterStringNullableWithDefault?: string | null; 1167 + /** 1168 + * This is a string that can be null with no default 1169 + */ 1170 + parameterStringNullableWithNoDefault?: string | null; 1171 + /** 1172 + * This is a string with default 1173 + */ 1174 + parameterStringWithDefault: string; 1175 + /** 1176 + * This is a string with empty default 1177 + */ 1178 + parameterStringWithEmptyDefault: string; 1179 + /** 1180 + * This is a string with no default 1181 + */ 1182 + parameterStringWithNoDefault: string; 1183 + }; 1184 + 1185 + export type CallWithNoContentResponseResponse = void; 1186 + 1187 + export type CallWithResponseAndNoContentResponseResponse = number | void; 1188 + 1189 + export type DummyAResponse = _400; 1190 + 1191 + export type DummyBResponse = void; 1192 + 1193 + export type CallWithResponseResponse = Import; 1194 + 1195 + export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 1196 + 1197 + export type CallWithResponsesResponse = { 1198 + readonly '@namespace.string'?: string; 1199 + readonly '@namespace.integer'?: number; 1200 + readonly value?: Array<ModelWithString>; 1201 + } | ModelThatExtends | ModelThatExtendsExtends; 1202 + 1203 + export type CollectionFormatData = { 1204 + /** 1205 + * This is an array parameter that is sent as csv format (comma-separated values) 1206 + */ 1207 + parameterArrayCsv: Array<(string)> | null; 1208 + /** 1209 + * This is an array parameter that is sent as multi format (multiple parameter instances) 1210 + */ 1211 + parameterArrayMulti: Array<(string)> | null; 1212 + /** 1213 + * This is an array parameter that is sent as pipes format (pipe-separated values) 1214 + */ 1215 + parameterArrayPipes: Array<(string)> | null; 1216 + /** 1217 + * This is an array parameter that is sent as ssv format (space-separated values) 1218 + */ 1219 + parameterArraySsv: Array<(string)> | null; 1220 + /** 1221 + * This is an array parameter that is sent as tsv format (tab-separated values) 1222 + */ 1223 + parameterArrayTsv: Array<(string)> | null; 1224 + }; 1225 + 1226 + export type TypesData = { 1227 + /** 1228 + * This is a number parameter 1229 + */ 1230 + id?: number; 1231 + /** 1232 + * This is an array parameter 1233 + */ 1234 + parameterArray: Array<(string)> | null; 1235 + /** 1236 + * This is a boolean parameter 1237 + */ 1238 + parameterBoolean: boolean | null; 1239 + /** 1240 + * This is a dictionary parameter 1241 + */ 1242 + parameterDictionary: { 1243 + [key: string]: unknown; 1244 + } | null; 1245 + /** 1246 + * This is an enum parameter 1247 + */ 1248 + parameterEnum: 'Success' | 'Warning' | 'Error' | null; 1249 + /** 1250 + * This is a number parameter 1251 + */ 1252 + parameterNumber: number; 1253 + /** 1254 + * This is an object parameter 1255 + */ 1256 + parameterObject: { 1257 + [key: string]: unknown; 1258 + } | null; 1259 + /** 1260 + * This is a string parameter 1261 + */ 1262 + parameterString: string | null; 1263 + }; 1264 + 1265 + export type TypesResponse = number | string | boolean | { 1266 + [key: string]: unknown; 1267 + }; 1268 + 1269 + export type UploadFileData = { 1270 + formData: (Blob | File); 1271 + }; 1272 + 1273 + export type UploadFileResponse = boolean; 1274 + 1275 + export type FileResponseData = { 1276 + id: string; 1277 + }; 1278 + 1279 + export type FileResponseResponse = (Blob | File); 1280 + 1281 + export type ComplexTypesData = { 1282 + /** 1283 + * Parameter containing object 1284 + */ 1285 + parameterObject: { 1286 + first?: { 1287 + second?: { 1288 + third?: string; 1289 + }; 1290 + }; 1291 + }; 1292 + /** 1293 + * Parameter containing reference 1294 + */ 1295 + parameterReference: ModelWithString; 1296 + }; 1297 + 1298 + export type ComplexTypesResponse = Array<ModelWithString>; 1299 + 1300 + export type MultipartRequestData = { 1301 + formData?: { 1302 + content?: (Blob | File); 1303 + data?: ModelWithString | null; 1304 + }; 1305 + }; 1306 + 1307 + export type MultipartResponseResponse = { 1308 + file?: (Blob | File); 1309 + metadata?: { 1310 + foo?: string; 1311 + bar?: string; 1312 + }; 1313 + }; 1314 + 1315 + export type ComplexParamsData = { 1316 + id: number; 1317 + requestBody?: { 1318 + readonly key: string | null; 1319 + name: string | null; 1320 + enabled?: boolean; 1321 + readonly type: 'Monkey' | 'Horse' | 'Bird'; 1322 + listOfModels?: Array<ModelWithString> | null; 1323 + listOfStrings?: Array<(string)> | null; 1324 + parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 1325 + readonly user?: { 1326 + readonly id?: number; 1327 + readonly name?: string | null; 1328 + }; 1329 + }; 1330 + }; 1331 + 1332 + export type ComplexParamsResponse = ModelWithString; 1333 + 1334 + export type CallWithResultFromHeaderResponse = string; 1335 + 1336 + export type TestErrorCodeData = { 1337 + /** 1338 + * Status code to return 1339 + */ 1340 + status: number; 1341 + }; 1342 + 1343 + export type TestErrorCodeResponse = unknown; 1344 + 1345 + export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 1346 + /** 1347 + * Dummy input param 1348 + */ 1349 + nonAsciiParamæøåÆøÅöôêÊ: number; 1350 + }; 1351 + 1352 + export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 1353 + 1354 + export type PutWithFormUrlEncodedData = { 1355 + formData: ArrayWithStrings; 1356 + }; 1357 + 1358 + export type $OpenApiTs = { 1359 + '/api/v{api-version}/no-tag': { 1360 + post: { 1361 + req: ImportData; 1362 + res: { 1363 + /** 1364 + * Success 1365 + */ 1366 + 200: ModelFromZendesk; 1367 + /** 1368 + * Default success response 1369 + */ 1370 + default: ModelWithReadOnlyAndWriteOnly; 1371 + }; 1372 + }; 1373 + }; 1374 + '/api/v{api-version}/simple/$count': { 1375 + get: { 1376 + res: { 1377 + /** 1378 + * Success 1379 + */ 1380 + 200: ModelFromZendesk; 1381 + }; 1382 + }; 1383 + }; 1384 + '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { 1385 + delete: { 1386 + req: DeleteFooData3; 1387 + }; 1388 + }; 1389 + '/api/v{api-version}/descriptions/': { 1390 + post: { 1391 + req: CallWithDescriptionsData; 1392 + }; 1393 + }; 1394 + '/api/v{api-version}/parameters/deprecated': { 1395 + post: { 1396 + req: DeprecatedCallData; 1397 + }; 1398 + }; 1399 + '/api/v{api-version}/parameters/{parameterPath}': { 1400 + post: { 1401 + req: CallWithParametersData; 1402 + }; 1403 + }; 1404 + '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { 1405 + post: { 1406 + req: CallWithWeirdParameterNamesData; 1407 + }; 1408 + }; 1409 + '/api/v{api-version}/parameters/': { 1410 + get: { 1411 + req: GetCallWithOptionalParamData; 1412 + }; 1413 + post: { 1414 + req: PostCallWithOptionalParamData; 1415 + res: { 1416 + /** 1417 + * Response is a simple number 1418 + */ 1419 + 200: number; 1420 + /** 1421 + * Success 1422 + */ 1423 + 204: void; 1424 + }; 1425 + }; 1426 + }; 1427 + '/api/v{api-version}/requestBody/': { 1428 + post: { 1429 + req: PostApiRequestBodyData; 1430 + }; 1431 + }; 1432 + '/api/v{api-version}/formData/': { 1433 + post: { 1434 + req: PostApiFormDataData; 1435 + }; 1436 + }; 1437 + '/api/v{api-version}/defaults': { 1438 + get: { 1439 + req: CallWithDefaultParametersData; 1440 + }; 1441 + post: { 1442 + req: CallWithDefaultOptionalParametersData; 1443 + }; 1444 + put: { 1445 + req: CallToTestOrderOfParamsData; 1446 + }; 1447 + }; 1448 + '/api/v{api-version}/no-content': { 1449 + get: { 1450 + res: { 1451 + /** 1452 + * Success 1453 + */ 1454 + 204: void; 1455 + }; 1456 + }; 1457 + }; 1458 + '/api/v{api-version}/multiple-tags/response-and-no-content': { 1459 + get: { 1460 + res: { 1461 + /** 1462 + * Response is a simple number 1463 + */ 1464 + 200: number; 1465 + /** 1466 + * Success 1467 + */ 1468 + 204: void; 1469 + }; 1470 + }; 1471 + }; 1472 + '/api/v{api-version}/multiple-tags/a': { 1473 + get: { 1474 + res: { 1475 + 200: _400; 1476 + }; 1477 + }; 1478 + }; 1479 + '/api/v{api-version}/multiple-tags/b': { 1480 + get: { 1481 + res: { 1482 + /** 1483 + * Success 1484 + */ 1485 + 204: void; 1486 + }; 1487 + }; 1488 + }; 1489 + '/api/v{api-version}/response': { 1490 + get: { 1491 + res: { 1492 + default: Import; 1493 + }; 1494 + }; 1495 + post: { 1496 + res: { 1497 + /** 1498 + * Message for 200 response 1499 + */ 1500 + 200: ModelWithBoolean & ModelWithInteger; 1501 + /** 1502 + * Message for 201 response 1503 + */ 1504 + 201: ModelWithString; 1505 + /** 1506 + * Message for 202 response 1507 + */ 1508 + 202: ModelWithString; 1509 + /** 1510 + * Message for 500 error 1511 + */ 1512 + 500: ModelWithStringError; 1513 + /** 1514 + * Message for 501 error 1515 + */ 1516 + 501: ModelWithStringError; 1517 + /** 1518 + * Message for 502 error 1519 + */ 1520 + 502: ModelWithStringError; 1521 + /** 1522 + * Message for 4XX errors 1523 + */ 1524 + '4XX': DictionaryWithArray; 1525 + /** 1526 + * Default error response 1527 + */ 1528 + default: ModelWithBoolean; 1529 + }; 1530 + }; 1531 + put: { 1532 + res: { 1533 + /** 1534 + * Message for 200 response 1535 + */ 1536 + 200: { 1537 + readonly '@namespace.string'?: string; 1538 + readonly '@namespace.integer'?: number; 1539 + readonly value?: Array<ModelWithString>; 1540 + }; 1541 + /** 1542 + * Message for 201 response 1543 + */ 1544 + 201: ModelThatExtends; 1545 + /** 1546 + * Message for 202 response 1547 + */ 1548 + 202: ModelThatExtendsExtends; 1549 + /** 1550 + * Message for 500 error 1551 + */ 1552 + 500: ModelWithStringError; 1553 + /** 1554 + * Message for 501 error 1555 + */ 1556 + 501: ModelWithStringError; 1557 + /** 1558 + * Message for 502 error 1559 + */ 1560 + 502: ModelWithStringError; 1561 + /** 1562 + * Message for default response 1563 + */ 1564 + default: ModelWithStringError; 1565 + }; 1566 + }; 1567 + }; 1568 + '/api/v{api-version}/collectionFormat': { 1569 + get: { 1570 + req: CollectionFormatData; 1571 + }; 1572 + }; 1573 + '/api/v{api-version}/types': { 1574 + get: { 1575 + req: TypesData; 1576 + res: { 1577 + /** 1578 + * Response is a simple number 1579 + */ 1580 + 200: number; 1581 + /** 1582 + * Response is a simple string 1583 + */ 1584 + 201: string; 1585 + /** 1586 + * Response is a simple boolean 1587 + */ 1588 + 202: boolean; 1589 + /** 1590 + * Response is a simple object 1591 + */ 1592 + 203: { 1593 + [key: string]: unknown; 1594 + }; 1595 + }; 1596 + }; 1597 + }; 1598 + '/api/v{api-version}/upload': { 1599 + post: { 1600 + req: UploadFileData; 1601 + res: { 1602 + 200: boolean; 1603 + }; 1604 + }; 1605 + }; 1606 + '/api/v{api-version}/file/{id}': { 1607 + get: { 1608 + req: FileResponseData; 1609 + res: { 1610 + /** 1611 + * Success 1612 + */ 1613 + 200: (Blob | File); 1614 + }; 1615 + }; 1616 + }; 1617 + '/api/v{api-version}/complex': { 1618 + get: { 1619 + req: ComplexTypesData; 1620 + res: { 1621 + /** 1622 + * Successful response 1623 + */ 1624 + 200: Array<ModelWithString>; 1625 + /** 1626 + * 400 `server` error 1627 + */ 1628 + 400: unknown; 1629 + /** 1630 + * 500 server error 1631 + */ 1632 + 500: unknown; 1633 + }; 1634 + }; 1635 + }; 1636 + '/api/v{api-version}/multipart': { 1637 + post: { 1638 + req: MultipartRequestData; 1639 + }; 1640 + get: { 1641 + res: { 1642 + /** 1643 + * OK 1644 + */ 1645 + 200: { 1646 + file?: (Blob | File); 1647 + metadata?: { 1648 + foo?: string; 1649 + bar?: string; 1650 + }; 1651 + }; 1652 + }; 1653 + }; 1654 + }; 1655 + '/api/v{api-version}/complex/{id}': { 1656 + put: { 1657 + req: ComplexParamsData; 1658 + res: { 1659 + /** 1660 + * Success 1661 + */ 1662 + 200: ModelWithString; 1663 + }; 1664 + }; 1665 + }; 1666 + '/api/v{api-version}/header': { 1667 + post: { 1668 + res: { 1669 + /** 1670 + * Successful response 1671 + */ 1672 + 200: string; 1673 + /** 1674 + * 400 server error 1675 + */ 1676 + 400: unknown; 1677 + /** 1678 + * 500 server error 1679 + */ 1680 + 500: unknown; 1681 + }; 1682 + }; 1683 + }; 1684 + '/api/v{api-version}/error': { 1685 + post: { 1686 + req: TestErrorCodeData; 1687 + res: { 1688 + /** 1689 + * Custom message: Successful response 1690 + */ 1691 + 200: unknown; 1692 + /** 1693 + * Custom message: Internal Server Error 1694 + */ 1695 + 500: unknown; 1696 + /** 1697 + * Custom message: Not Implemented 1698 + */ 1699 + 501: unknown; 1700 + /** 1701 + * Custom message: Bad Gateway 1702 + */ 1703 + 502: unknown; 1704 + /** 1705 + * Custom message: Service Unavailable 1706 + */ 1707 + 503: unknown; 1708 + }; 1709 + }; 1710 + }; 1711 + '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { 1712 + post: { 1713 + req: NonAsciiæøåÆøÅöôêÊ字符串Data; 1714 + res: { 1715 + /** 1716 + * Successful response 1717 + */ 1718 + 200: Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 1719 + }; 1720 + }; 1721 + put: { 1722 + req: PutWithFormUrlEncodedData; 1723 + }; 1724 + }; 1725 + };
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap
··· 897 897 }; 898 898 899 899 /** 900 + * This schema was giving PascalCase transformations a hard time 901 + */ 902 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 903 + /** 904 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 905 + */ 906 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 907 + }; 908 + 909 + /** 910 + * This schema was giving PascalCase transformations a hard time 911 + */ 912 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 913 + /** 914 + * Specifies the target ResourceVersion 915 + */ 916 + resourceVersion?: string; 917 + /** 918 + * Specifies the target UID. 919 + */ 920 + uid?: string; 921 + }; 922 + 923 + /** 900 924 * This is a reusable parameter 901 925 */ 902 926 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap
··· 897 897 }; 898 898 899 899 /** 900 + * This schema was giving PascalCase transformations a hard time 901 + */ 902 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 903 + /** 904 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 905 + */ 906 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 907 + }; 908 + 909 + /** 910 + * This schema was giving PascalCase transformations a hard time 911 + */ 912 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 913 + /** 914 + * Specifies the target ResourceVersion 915 + */ 916 + resourceVersion?: string; 917 + /** 918 + * Specifies the target UID. 919 + */ 920 + uid?: string; 921 + }; 922 + 923 + /** 900 924 * This is a reusable parameter 901 925 */ 902 926 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap
··· 976 976 }; 977 977 978 978 /** 979 + * This schema was giving PascalCase transformations a hard time 980 + */ 981 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 982 + /** 983 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 984 + */ 985 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 986 + }; 987 + 988 + /** 989 + * This schema was giving PascalCase transformations a hard time 990 + */ 991 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 992 + /** 993 + * Specifies the target ResourceVersion 994 + */ 995 + resourceVersion?: string; 996 + /** 997 + * Specifies the target UID. 998 + */ 999 + uid?: string; 1000 + }; 1001 + 1002 + /** 979 1003 * This is a reusable parameter 980 1004 */ 981 1005 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript_namespace/types.gen.ts.snap
··· 1007 1007 }; 1008 1008 1009 1009 /** 1010 + * This schema was giving PascalCase transformations a hard time 1011 + */ 1012 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1013 + /** 1014 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1015 + */ 1016 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1017 + }; 1018 + 1019 + /** 1020 + * This schema was giving PascalCase transformations a hard time 1021 + */ 1022 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1023 + /** 1024 + * Specifies the target ResourceVersion 1025 + */ 1026 + resourceVersion?: string; 1027 + /** 1028 + * Specifies the target UID. 1029 + */ 1030 + uid?: string; 1031 + }; 1032 + 1033 + /** 1010 1034 * This is a reusable parameter 1011 1035 */ 1012 1036 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
packages/openapi-ts/test/__snapshots__/test/generated/v3_pascalcase/index.ts.snap packages/openapi-ts/test/__snapshots__/test/generated/v3-types-PascalCase/index.ts.snap
-811
packages/openapi-ts/test/__snapshots__/test/generated/v3_pascalcase/types.gen.ts.snap
··· 1 - // This file is auto-generated by @hey-api/openapi-ts 2 - 3 - /** 4 - * Testing multiline comments in string: First line 5 - * Second line 6 - * 7 - * Fourth line 8 - */ 9 - export type CamelCaseCommentWithBreaks = number; 10 - 11 - /** 12 - * This is a simple array with properties 13 - */ 14 - export type ArrayWithProperties = Array<{ 15 - '16x16'?: CamelCaseCommentWithBreaks; 16 - bar?: string; 17 - }>; 18 - 19 - export type ImportData = { 20 - requestBody: ModelWithReadOnlyAndWriteOnly | ModelWithArrayReadOnlyAndWriteOnly; 21 - }; 22 - 23 - export type ImportResponse = ModelFromZendesk | ModelWithReadOnlyAndWriteOnly; 24 - 25 - export type ApiVversionOdataControllerCountResponse = ModelFromZendesk; 26 - 27 - export type DeleteFooData = { 28 - /** 29 - * bar in method 30 - */ 31 - barParam: string; 32 - /** 33 - * foo in method 34 - */ 35 - fooParam: string; 36 - /** 37 - * Parameter with illegal characters 38 - */ 39 - xFooBar: ModelWithString; 40 - }; 41 - 42 - export type CallWithDescriptionsData = { 43 - /** 44 - * Testing backticks in string: `backticks` and ```multiple backticks``` should work 45 - */ 46 - parameterWithBackticks?: unknown; 47 - /** 48 - * Testing multiline comments in string: First line 49 - * Second line 50 - * 51 - * Fourth line 52 - */ 53 - parameterWithBreaks?: unknown; 54 - /** 55 - * Testing expression placeholders in string: ${expression} should work 56 - */ 57 - parameterWithExpressionPlaceholders?: unknown; 58 - /** 59 - * Testing quotes in string: 'single quote''' and "double quotes""" should work 60 - */ 61 - parameterWithQuotes?: unknown; 62 - /** 63 - * Testing reserved characters in string: * inline * and ** inline ** should work 64 - */ 65 - parameterWithReservedCharacters?: unknown; 66 - /** 67 - * Testing slashes in string: \backwards\\\ and /forwards/// should work 68 - */ 69 - parameterWithSlashes?: unknown; 70 - }; 71 - 72 - export type DeprecatedCallData = { 73 - /** 74 - * This parameter is deprecated 75 - * @deprecated 76 - */ 77 - parameter: DeprecatedModel | null; 78 - }; 79 - 80 - export type CallWithParametersData = { 81 - /** 82 - * This is the parameter that goes into the query params 83 - */ 84 - cursor: string | null; 85 - fooAllOfEnum: ModelWithNestedArrayEnumsDataFoo; 86 - fooRefEnum?: ModelWithNestedArrayEnumsDataFoo; 87 - /** 88 - * This is the parameter that goes into the cookie 89 - */ 90 - parameterCookie: string | null; 91 - /** 92 - * This is the parameter that goes into the header 93 - */ 94 - parameterHeader: string | null; 95 - /** 96 - * This is the parameter that goes into the path 97 - */ 98 - parameterPath: string | null; 99 - /** 100 - * This is the parameter that goes into the body 101 - */ 102 - requestBody: { 103 - [key: string]: unknown; 104 - } | null; 105 - }; 106 - 107 - export type CallWithWeirdParameterNamesData = { 108 - /** 109 - * This is the parameter with a reserved keyword 110 - */ 111 - _default?: string; 112 - /** 113 - * This is the parameter that goes into the cookie 114 - */ 115 - parameterCookie: string | null; 116 - /** 117 - * This is the parameter that goes into the request header 118 - */ 119 - parameterHeader: string | null; 120 - /** 121 - * This is the parameter that goes into the path 122 - */ 123 - parameterPath1?: string; 124 - /** 125 - * This is the parameter that goes into the path 126 - */ 127 - parameterPath2?: string; 128 - /** 129 - * This is the parameter that goes into the path 130 - */ 131 - parameterPath3?: string; 132 - /** 133 - * This is the parameter that goes into the request query params 134 - */ 135 - parameterQuery: string | null; 136 - /** 137 - * This is the parameter that goes into the body 138 - */ 139 - requestBody: ModelWithString | null; 140 - }; 141 - 142 - export type GetCallWithOptionalParamData = { 143 - /** 144 - * This is an optional parameter 145 - */ 146 - page?: number; 147 - /** 148 - * This is a required parameter 149 - */ 150 - requestBody: ModelWithOneOfEnum; 151 - }; 152 - 153 - export type PostCallWithOptionalParamData = { 154 - /** 155 - * This is a required parameter 156 - */ 157 - parameter: Pageable; 158 - /** 159 - * This is an optional parameter 160 - */ 161 - requestBody?: { 162 - offset?: number | null; 163 - }; 164 - }; 165 - 166 - export type PostCallWithOptionalParamResponse = number | void; 167 - 168 - export type PostApiRequestBodyData = { 169 - /** 170 - * A reusable request body 171 - */ 172 - foo?: ModelWithString; 173 - /** 174 - * This is a reusable parameter 175 - */ 176 - parameter?: string; 177 - }; 178 - 179 - export type PostApiFormDataData = { 180 - /** 181 - * A reusable request body 182 - */ 183 - formData?: ModelWithString; 184 - /** 185 - * This is a reusable parameter 186 - */ 187 - parameter?: string; 188 - }; 189 - 190 - export type CallWithDefaultParametersData = { 191 - /** 192 - * This is a simple boolean with default value 193 - */ 194 - parameterBoolean?: boolean | null; 195 - /** 196 - * This is a simple enum with default value 197 - */ 198 - parameterEnum?: 'Success' | 'Warning' | 'Error'; 199 - /** 200 - * This is a simple model with default value 201 - */ 202 - parameterModel?: ModelWithString | null; 203 - /** 204 - * This is a simple number with default value 205 - */ 206 - parameterNumber?: number | null; 207 - /** 208 - * This is a simple string with default value 209 - */ 210 - parameterString?: string | null; 211 - }; 212 - 213 - export type CallWithDefaultOptionalParametersData = { 214 - /** 215 - * This is a simple boolean that is optional with default value 216 - */ 217 - parameterBoolean?: boolean; 218 - /** 219 - * This is a simple enum that is optional with default value 220 - */ 221 - parameterEnum?: 'Success' | 'Warning' | 'Error'; 222 - /** 223 - * This is a simple model that is optional with default value 224 - */ 225 - parameterModel?: ModelWithString; 226 - /** 227 - * This is a simple number that is optional with default value 228 - */ 229 - parameterNumber?: number; 230 - /** 231 - * This is a simple string that is optional with default value 232 - */ 233 - parameterString?: string; 234 - }; 235 - 236 - export type CallToTestOrderOfParamsData = { 237 - /** 238 - * This is a optional string with default 239 - */ 240 - parameterOptionalStringWithDefault?: string; 241 - /** 242 - * This is a optional string with empty default 243 - */ 244 - parameterOptionalStringWithEmptyDefault?: string; 245 - /** 246 - * This is a optional string with no default 247 - */ 248 - parameterOptionalStringWithNoDefault?: string; 249 - /** 250 - * This is a string that can be null with default 251 - */ 252 - parameterStringNullableWithDefault?: string | null; 253 - /** 254 - * This is a string that can be null with no default 255 - */ 256 - parameterStringNullableWithNoDefault?: string | null; 257 - /** 258 - * This is a string with default 259 - */ 260 - parameterStringWithDefault: string; 261 - /** 262 - * This is a string with empty default 263 - */ 264 - parameterStringWithEmptyDefault: string; 265 - /** 266 - * This is a string with no default 267 - */ 268 - parameterStringWithNoDefault: string; 269 - }; 270 - 271 - export type CallWithNoContentResponseResponse = void; 272 - 273 - export type CallWithResponseAndNoContentResponseResponse = number | void; 274 - 275 - export type DummyAResponse = _400; 276 - 277 - export type DummyBResponse = void; 278 - 279 - export type CallWithResponseResponse = Import; 280 - 281 - export type CallWithDuplicateResponsesResponse = ModelWithBoolean & ModelWithInteger | ModelWithString; 282 - 283 - export type CallWithResponsesResponse = { 284 - readonly '@namespace.string'?: string; 285 - readonly '@namespace.integer'?: number; 286 - readonly value?: Array<ModelWithString>; 287 - } | ModelThatExtends | ModelThatExtendsExtends; 288 - 289 - export type CollectionFormatData = { 290 - /** 291 - * This is an array parameter that is sent as csv format (comma-separated values) 292 - */ 293 - parameterArrayCsv: Array<(string)> | null; 294 - /** 295 - * This is an array parameter that is sent as multi format (multiple parameter instances) 296 - */ 297 - parameterArrayMulti: Array<(string)> | null; 298 - /** 299 - * This is an array parameter that is sent as pipes format (pipe-separated values) 300 - */ 301 - parameterArrayPipes: Array<(string)> | null; 302 - /** 303 - * This is an array parameter that is sent as ssv format (space-separated values) 304 - */ 305 - parameterArraySsv: Array<(string)> | null; 306 - /** 307 - * This is an array parameter that is sent as tsv format (tab-separated values) 308 - */ 309 - parameterArrayTsv: Array<(string)> | null; 310 - }; 311 - 312 - export type TypesData = { 313 - /** 314 - * This is a number parameter 315 - */ 316 - id?: number; 317 - /** 318 - * This is an array parameter 319 - */ 320 - parameterArray: Array<(string)> | null; 321 - /** 322 - * This is a boolean parameter 323 - */ 324 - parameterBoolean: boolean | null; 325 - /** 326 - * This is a dictionary parameter 327 - */ 328 - parameterDictionary: { 329 - [key: string]: unknown; 330 - } | null; 331 - /** 332 - * This is an enum parameter 333 - */ 334 - parameterEnum: 'Success' | 'Warning' | 'Error' | null; 335 - /** 336 - * This is a number parameter 337 - */ 338 - parameterNumber: number; 339 - /** 340 - * This is an object parameter 341 - */ 342 - parameterObject: { 343 - [key: string]: unknown; 344 - } | null; 345 - /** 346 - * This is a string parameter 347 - */ 348 - parameterString: string | null; 349 - }; 350 - 351 - export type TypesResponse = number | string | boolean | { 352 - [key: string]: unknown; 353 - }; 354 - 355 - export type UploadFileData = { 356 - formData: (Blob | File); 357 - }; 358 - 359 - export type UploadFileResponse = boolean; 360 - 361 - export type FileResponseData = { 362 - id: string; 363 - }; 364 - 365 - export type FileResponseResponse = (Blob | File); 366 - 367 - export type ComplexTypesData = { 368 - /** 369 - * Parameter containing object 370 - */ 371 - parameterObject: { 372 - first?: { 373 - second?: { 374 - third?: string; 375 - }; 376 - }; 377 - }; 378 - /** 379 - * Parameter containing reference 380 - */ 381 - parameterReference: ModelWithString; 382 - }; 383 - 384 - export type ComplexTypesResponse = Array<ModelWithString>; 385 - 386 - export type MultipartRequestData = { 387 - formData?: { 388 - content?: (Blob | File); 389 - data?: ModelWithString | null; 390 - }; 391 - }; 392 - 393 - export type MultipartResponseResponse = { 394 - file?: (Blob | File); 395 - metadata?: { 396 - foo?: string; 397 - bar?: string; 398 - }; 399 - }; 400 - 401 - export type ComplexParamsData = { 402 - id: number; 403 - requestBody?: { 404 - readonly key: string | null; 405 - name: string | null; 406 - enabled?: boolean; 407 - readonly type: 'Monkey' | 'Horse' | 'Bird'; 408 - listOfModels?: Array<ModelWithString> | null; 409 - listOfStrings?: Array<(string)> | null; 410 - parameters: ModelWithString | ModelWithEnum | ModelWithArray | ModelWithDictionary; 411 - readonly user?: { 412 - readonly id?: number; 413 - readonly name?: string | null; 414 - }; 415 - }; 416 - }; 417 - 418 - export type ComplexParamsResponse = ModelWithString; 419 - 420 - export type CallWithResultFromHeaderResponse = string; 421 - 422 - export type TestErrorCodeData = { 423 - /** 424 - * Status code to return 425 - */ 426 - status: number; 427 - }; 428 - 429 - export type TestErrorCodeResponse = unknown; 430 - 431 - export type NonAsciiæøåÆøÅöôêÊ字符串Data = { 432 - /** 433 - * Dummy input param 434 - */ 435 - nonAsciiParamæøåÆøÅöôêÊ: number; 436 - }; 437 - 438 - export type NonAsciiæøåÆøÅöôêÊ字符串Response = Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 439 - 440 - export type PutWithFormUrlEncodedData = { 441 - formData: ArrayWithStrings; 442 - }; 443 - 444 - export type $OpenApiTs = { 445 - '/api/v{api-version}/no-tag': { 446 - post: { 447 - req: ImportData; 448 - res: { 449 - /** 450 - * Success 451 - */ 452 - 200: ModelFromZendesk; 453 - /** 454 - * Default success response 455 - */ 456 - default: ModelWithReadOnlyAndWriteOnly; 457 - }; 458 - }; 459 - }; 460 - '/api/v{api-version}/simple/$count': { 461 - get: { 462 - res: { 463 - /** 464 - * Success 465 - */ 466 - 200: ModelFromZendesk; 467 - }; 468 - }; 469 - }; 470 - '/api/v{api-version}/foo/{foo_param}/bar/{BarParam}': { 471 - delete: { 472 - req: DeleteFooData; 473 - }; 474 - }; 475 - '/api/v{api-version}/descriptions/': { 476 - post: { 477 - req: CallWithDescriptionsData; 478 - }; 479 - }; 480 - '/api/v{api-version}/parameters/deprecated': { 481 - post: { 482 - req: DeprecatedCallData; 483 - }; 484 - }; 485 - '/api/v{api-version}/parameters/{parameterPath}': { 486 - post: { 487 - req: CallWithParametersData; 488 - }; 489 - }; 490 - '/api/v{api-version}/parameters/{parameter.path.1}/{parameter-path-2}/{PARAMETER-PATH-3}': { 491 - post: { 492 - req: CallWithWeirdParameterNamesData; 493 - }; 494 - }; 495 - '/api/v{api-version}/parameters/': { 496 - get: { 497 - req: GetCallWithOptionalParamData; 498 - }; 499 - post: { 500 - req: PostCallWithOptionalParamData; 501 - res: { 502 - /** 503 - * Response is a simple number 504 - */ 505 - 200: number; 506 - /** 507 - * Success 508 - */ 509 - 204: void; 510 - }; 511 - }; 512 - }; 513 - '/api/v{api-version}/requestBody/': { 514 - post: { 515 - req: PostApiRequestBodyData; 516 - }; 517 - }; 518 - '/api/v{api-version}/formData/': { 519 - post: { 520 - req: PostApiFormDataData; 521 - }; 522 - }; 523 - '/api/v{api-version}/defaults': { 524 - get: { 525 - req: CallWithDefaultParametersData; 526 - }; 527 - post: { 528 - req: CallWithDefaultOptionalParametersData; 529 - }; 530 - put: { 531 - req: CallToTestOrderOfParamsData; 532 - }; 533 - }; 534 - '/api/v{api-version}/no-content': { 535 - get: { 536 - res: { 537 - /** 538 - * Success 539 - */ 540 - 204: void; 541 - }; 542 - }; 543 - }; 544 - '/api/v{api-version}/multiple-tags/response-and-no-content': { 545 - get: { 546 - res: { 547 - /** 548 - * Response is a simple number 549 - */ 550 - 200: number; 551 - /** 552 - * Success 553 - */ 554 - 204: void; 555 - }; 556 - }; 557 - }; 558 - '/api/v{api-version}/multiple-tags/a': { 559 - get: { 560 - res: { 561 - 200: _400; 562 - }; 563 - }; 564 - }; 565 - '/api/v{api-version}/multiple-tags/b': { 566 - get: { 567 - res: { 568 - /** 569 - * Success 570 - */ 571 - 204: void; 572 - }; 573 - }; 574 - }; 575 - '/api/v{api-version}/response': { 576 - get: { 577 - res: { 578 - default: Import; 579 - }; 580 - }; 581 - post: { 582 - res: { 583 - /** 584 - * Message for 200 response 585 - */ 586 - 200: ModelWithBoolean & ModelWithInteger; 587 - /** 588 - * Message for 201 response 589 - */ 590 - 201: ModelWithString; 591 - /** 592 - * Message for 202 response 593 - */ 594 - 202: ModelWithString; 595 - /** 596 - * Message for 500 error 597 - */ 598 - 500: ModelWithStringError; 599 - /** 600 - * Message for 501 error 601 - */ 602 - 501: ModelWithStringError; 603 - /** 604 - * Message for 502 error 605 - */ 606 - 502: ModelWithStringError; 607 - /** 608 - * Message for 4XX errors 609 - */ 610 - '4XX': DictionaryWithArray; 611 - /** 612 - * Default error response 613 - */ 614 - default: ModelWithBoolean; 615 - }; 616 - }; 617 - put: { 618 - res: { 619 - /** 620 - * Message for 200 response 621 - */ 622 - 200: { 623 - readonly '@namespace.string'?: string; 624 - readonly '@namespace.integer'?: number; 625 - readonly value?: Array<ModelWithString>; 626 - }; 627 - /** 628 - * Message for 201 response 629 - */ 630 - 201: ModelThatExtends; 631 - /** 632 - * Message for 202 response 633 - */ 634 - 202: ModelThatExtendsExtends; 635 - /** 636 - * Message for 500 error 637 - */ 638 - 500: ModelWithStringError; 639 - /** 640 - * Message for 501 error 641 - */ 642 - 501: ModelWithStringError; 643 - /** 644 - * Message for 502 error 645 - */ 646 - 502: ModelWithStringError; 647 - /** 648 - * Message for default response 649 - */ 650 - default: ModelWithStringError; 651 - }; 652 - }; 653 - }; 654 - '/api/v{api-version}/collectionFormat': { 655 - get: { 656 - req: CollectionFormatData; 657 - }; 658 - }; 659 - '/api/v{api-version}/types': { 660 - get: { 661 - req: TypesData; 662 - res: { 663 - /** 664 - * Response is a simple number 665 - */ 666 - 200: number; 667 - /** 668 - * Response is a simple string 669 - */ 670 - 201: string; 671 - /** 672 - * Response is a simple boolean 673 - */ 674 - 202: boolean; 675 - /** 676 - * Response is a simple object 677 - */ 678 - 203: { 679 - [key: string]: unknown; 680 - }; 681 - }; 682 - }; 683 - }; 684 - '/api/v{api-version}/upload': { 685 - post: { 686 - req: UploadFileData; 687 - res: { 688 - 200: boolean; 689 - }; 690 - }; 691 - }; 692 - '/api/v{api-version}/file/{id}': { 693 - get: { 694 - req: FileResponseData; 695 - res: { 696 - /** 697 - * Success 698 - */ 699 - 200: (Blob | File); 700 - }; 701 - }; 702 - }; 703 - '/api/v{api-version}/complex': { 704 - get: { 705 - req: ComplexTypesData; 706 - res: { 707 - /** 708 - * Successful response 709 - */ 710 - 200: Array<ModelWithString>; 711 - /** 712 - * 400 `server` error 713 - */ 714 - 400: unknown; 715 - /** 716 - * 500 server error 717 - */ 718 - 500: unknown; 719 - }; 720 - }; 721 - }; 722 - '/api/v{api-version}/multipart': { 723 - post: { 724 - req: MultipartRequestData; 725 - }; 726 - get: { 727 - res: { 728 - /** 729 - * OK 730 - */ 731 - 200: { 732 - file?: (Blob | File); 733 - metadata?: { 734 - foo?: string; 735 - bar?: string; 736 - }; 737 - }; 738 - }; 739 - }; 740 - }; 741 - '/api/v{api-version}/complex/{id}': { 742 - put: { 743 - req: ComplexParamsData; 744 - res: { 745 - /** 746 - * Success 747 - */ 748 - 200: ModelWithString; 749 - }; 750 - }; 751 - }; 752 - '/api/v{api-version}/header': { 753 - post: { 754 - res: { 755 - /** 756 - * Successful response 757 - */ 758 - 200: string; 759 - /** 760 - * 400 server error 761 - */ 762 - 400: unknown; 763 - /** 764 - * 500 server error 765 - */ 766 - 500: unknown; 767 - }; 768 - }; 769 - }; 770 - '/api/v{api-version}/error': { 771 - post: { 772 - req: TestErrorCodeData; 773 - res: { 774 - /** 775 - * Custom message: Successful response 776 - */ 777 - 200: unknown; 778 - /** 779 - * Custom message: Internal Server Error 780 - */ 781 - 500: unknown; 782 - /** 783 - * Custom message: Not Implemented 784 - */ 785 - 501: unknown; 786 - /** 787 - * Custom message: Bad Gateway 788 - */ 789 - 502: unknown; 790 - /** 791 - * Custom message: Service Unavailable 792 - */ 793 - 503: unknown; 794 - }; 795 - }; 796 - }; 797 - '/api/v{api-version}/non-ascii-æøåÆØÅöôêÊ字符串': { 798 - post: { 799 - req: NonAsciiæøåÆøÅöôêÊ字符串Data; 800 - res: { 801 - /** 802 - * Successful response 803 - */ 804 - 200: Array<NonAsciiStringæøåÆøÅöôêÊ字符串>; 805 - }; 806 - }; 807 - put: { 808 - req: PutWithFormUrlEncodedData; 809 - }; 810 - }; 811 - };
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_services_name/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_types/types.gen.ts.snap
··· 897 897 }; 898 898 899 899 /** 900 + * This schema was giving PascalCase transformations a hard time 901 + */ 902 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 903 + /** 904 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 905 + */ 906 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 907 + }; 908 + 909 + /** 910 + * This schema was giving PascalCase transformations a hard time 911 + */ 912 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 913 + /** 914 + * Specifies the target ResourceVersion 915 + */ 916 + resourceVersion?: string; 917 + /** 918 + * Specifies the target UID. 919 + */ 920 + uid?: string; 921 + }; 922 + 923 + /** 900 924 * This is a reusable parameter 901 925 */ 902 926 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_types_no_tree/types.gen.ts.snap
··· 897 897 }; 898 898 899 899 /** 900 + * This schema was giving PascalCase transformations a hard time 901 + */ 902 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 903 + /** 904 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 905 + */ 906 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 907 + }; 908 + 909 + /** 910 + * This schema was giving PascalCase transformations a hard time 911 + */ 912 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 913 + /** 914 + * Specifies the target ResourceVersion 915 + */ 916 + resourceVersion?: string; 917 + /** 918 + * Specifies the target UID. 919 + */ 920 + uid?: string; 921 + }; 922 + 923 + /** 900 924 * This is a reusable parameter 901 925 */ 902 926 export type ParameterSimpleParameter = string;
+24
packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap
··· 1020 1020 }; 1021 1021 1022 1022 /** 1023 + * This schema was giving PascalCase transformations a hard time 1024 + */ 1025 + export type io_k8s_apimachinery_pkg_apis_meta_v1_DeleteOptions = { 1026 + /** 1027 + * Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned. 1028 + */ 1029 + preconditions?: io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions; 1030 + }; 1031 + 1032 + /** 1033 + * This schema was giving PascalCase transformations a hard time 1034 + */ 1035 + export type io_k8s_apimachinery_pkg_apis_meta_v1_Preconditions = { 1036 + /** 1037 + * Specifies the target ResourceVersion 1038 + */ 1039 + resourceVersion?: string; 1040 + /** 1041 + * Specifies the target UID. 1042 + */ 1043 + uid?: string; 1044 + }; 1045 + 1046 + /** 1023 1047 * This is a reusable parameter 1024 1048 */ 1025 1049 export type ParameterSimpleParameter = string;
+2 -3
packages/openapi-ts/test/index.spec.ts
··· 273 273 exportCore: false, 274 274 services: false, 275 275 types: { 276 - include: '^(CamelCaseCommentWithBreaks|ArrayWithProperties)', 277 276 name: 'PascalCase', 278 277 }, 279 278 }), 280 - description: 'generate pascalcase types', 281 - name: 'v3_pascalcase', 279 + description: 'generate PascalCase types', 280 + name: 'v3-types-PascalCase', 282 281 }, 283 282 { 284 283 config: createConfig({
+11 -11
packages/openapi-ts/test/sample.cjs
··· 5 5 const config = { 6 6 client: { 7 7 // bundle: true, 8 - name: '@hey-api/client-axios', 9 - // name: '@hey-api/client-fetch', 8 + // name: '@hey-api/client-axios', 9 + name: '@hey-api/client-fetch', 10 10 }, 11 11 debug: true, 12 12 // input: './test/spec/v3-transforms.json', ··· 17 17 output: { 18 18 path: './test/generated/sample/', 19 19 }, 20 - plugins: [ 21 - { 22 - // infiniteQueryOptions: false, 23 - // mutationOptions: false, 24 - name: '@tanstack/react-query', 25 - // queryOptions: false, 26 - }, 27 - ], 20 + // plugins: [ 21 + // { 22 + // // infiniteQueryOptions: false, 23 + // // mutationOptions: false, 24 + // name: '@tanstack/react-query', 25 + // // queryOptions: false, 26 + // }, 27 + // ], 28 28 schemas: { 29 29 export: false, 30 30 }, ··· 40 40 // export: false, 41 41 // include: 42 42 // '^(_400|CompositionWithOneOfAndProperties)', 43 - // name: 'PascalCase', 43 + name: 'PascalCase', 44 44 // tree: false, 45 45 }, 46 46 // useOptions: false,
+28
packages/openapi-ts/test/spec/v3.json
··· 3429 3429 ] 3430 3430 } 3431 3431 } 3432 + }, 3433 + "io.k8s.apimachinery.pkg.apis.meta.v1.DeleteOptions": { 3434 + "description": "This schema was giving PascalCase transformations a hard time", 3435 + "properties": { 3436 + "preconditions": { 3437 + "allOf": [ 3438 + { 3439 + "$ref": "#/components/schemas/io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions" 3440 + } 3441 + ], 3442 + "description": "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned." 3443 + } 3444 + }, 3445 + "type": "object" 3446 + }, 3447 + "io.k8s.apimachinery.pkg.apis.meta.v1.Preconditions": { 3448 + "description": "This schema was giving PascalCase transformations a hard time", 3449 + "properties": { 3450 + "resourceVersion": { 3451 + "description": "Specifies the target ResourceVersion", 3452 + "type": "string" 3453 + }, 3454 + "uid": { 3455 + "description": "Specifies the target UID.", 3456 + "type": "string" 3457 + } 3458 + }, 3459 + "type": "object" 3432 3460 } 3433 3461 } 3434 3462 }
+15 -24
pnpm-lock.yaml
··· 404 404 c12: 405 405 specifier: 1.11.1 406 406 version: 1.11.1(magicast@0.3.4) 407 - camelcase: 408 - specifier: 8.0.0 409 - version: 8.0.0 410 407 commander: 411 408 specifier: 12.1.0 412 409 version: 12.1.0 ··· 3758 3755 camelcase@6.3.0: 3759 3756 resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} 3760 3757 engines: {node: '>=10'} 3761 - 3762 - camelcase@8.0.0: 3763 - resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} 3764 - engines: {node: '>=16'} 3765 3758 3766 3759 caniuse-lite@1.0.30001636: 3767 3760 resolution: {integrity: sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg==} ··· 11256 11249 11257 11250 camelcase@6.3.0: {} 11258 11251 11259 - camelcase@8.0.0: {} 11260 - 11261 11252 caniuse-lite@1.0.30001636: {} 11262 11253 11263 11254 chai@4.4.1: ··· 12923 12914 12924 12915 magicast@0.3.4: 12925 12916 dependencies: 12926 - '@babel/parser': 7.24.7 12927 - '@babel/types': 7.24.7 12917 + '@babel/parser': 7.25.3 12918 + '@babel/types': 7.25.2 12928 12919 source-map-js: 1.2.0 12929 12920 12930 12921 make-dir@2.1.0: ··· 13501 13492 mlly: 1.7.1 13502 13493 pathe: 1.1.2 13503 13494 13504 - postcss-import@15.1.0(postcss@8.4.39): 13495 + postcss-import@15.1.0(postcss@8.4.41): 13505 13496 dependencies: 13506 - postcss: 8.4.39 13497 + postcss: 8.4.41 13507 13498 postcss-value-parser: 4.2.0 13508 13499 read-cache: 1.0.0 13509 13500 resolve: 1.22.8 13510 13501 13511 - postcss-js@4.0.1(postcss@8.4.39): 13502 + postcss-js@4.0.1(postcss@8.4.41): 13512 13503 dependencies: 13513 13504 camelcase-css: 2.0.1 13514 - postcss: 8.4.39 13505 + postcss: 8.4.41 13515 13506 13516 - postcss-load-config@4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): 13507 + postcss-load-config@4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)): 13517 13508 dependencies: 13518 13509 lilconfig: 3.1.2 13519 13510 yaml: 2.4.5 13520 13511 optionalDependencies: 13521 - postcss: 8.4.39 13512 + postcss: 8.4.41 13522 13513 ts-node: 10.9.2(@types/node@20.14.10)(typescript@5.5.3) 13523 13514 13524 13515 postcss-loader@8.1.1(postcss@8.4.35)(typescript@5.5.3)(webpack@5.90.3(esbuild@0.20.1)): ··· 13555 13546 icss-utils: 5.1.0(postcss@8.4.39) 13556 13547 postcss: 8.4.39 13557 13548 13558 - postcss-nested@6.0.1(postcss@8.4.39): 13549 + postcss-nested@6.0.1(postcss@8.4.41): 13559 13550 dependencies: 13560 - postcss: 8.4.39 13551 + postcss: 8.4.41 13561 13552 postcss-selector-parser: 6.1.0 13562 13553 13563 13554 postcss-selector-parser@6.1.0: ··· 14324 14315 normalize-path: 3.0.0 14325 14316 object-hash: 3.0.0 14326 14317 picocolors: 1.0.1 14327 - postcss: 8.4.39 14328 - postcss-import: 15.1.0(postcss@8.4.39) 14329 - postcss-js: 4.0.1(postcss@8.4.39) 14330 - postcss-load-config: 4.0.2(postcss@8.4.39)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) 14331 - postcss-nested: 6.0.1(postcss@8.4.39) 14318 + postcss: 8.4.41 14319 + postcss-import: 15.1.0(postcss@8.4.41) 14320 + postcss-js: 4.0.1(postcss@8.4.41) 14321 + postcss-load-config: 4.0.2(postcss@8.4.41)(ts-node@10.9.2(@types/node@20.14.10)(typescript@5.5.3)) 14322 + postcss-nested: 6.0.1(postcss@8.4.41) 14332 14323 postcss-selector-parser: 6.1.0 14333 14324 resolve: 1.22.8 14334 14325 sucrase: 3.35.0