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

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #948 from hey-api/fix/schemas-generics

fix: handle schemas with generics from C#

authored by

Lubos and committed by
GitHub
34f216f6 e4e4407e

+508 -37
+5
.changeset/angry-crabs-count.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: handle schemas with generics from C#
+1
packages/openapi-ts/src/openApi/common/parser/sanitize.ts
··· 18 18 .replace(/[^$\u200c\u200d\p{ID_Continue}]/gu, '_'); 19 19 20 20 export const ensureValidTypeScriptJavaScriptIdentifier = (name: string) => { 21 + illegalStartCharactersRegExp.lastIndex = 0; 21 22 const startsWithIllegalCharacter = illegalStartCharactersRegExp.test(name); 22 23 // avoid removing all characters in case they're all illegal 23 24 const input = startsWithIllegalCharacter ? `_${name}` : name;
+15 -2
packages/openapi-ts/src/openApi/common/parser/type.ts
··· 55 55 }; 56 56 57 57 /** 58 + * Matches characters inside square brackets, including the brackets. Does not 59 + * match if the opening bracket is preceded by "`1" which is a syntax for generics 60 + * from C#. 61 + * 62 + * Hello[World] -> matches [World] 63 + * Hello`1[World] -> no match 64 + * string[] -> matches [] 65 + */ 66 + export const hasSquareBracketsRegExp = /(?<!`1)\[.*\]$/g; 67 + 68 + /** 58 69 * Parse any string value into a type object. 59 70 * @param type String or String[] value like "integer", "Link[Model]" or ["string", "null"]. 60 71 * @param format String value like "binary" or "date". 61 72 */ 62 73 export const getType = ({ 63 - // eslint-disable-next-line @typescript-eslint/no-unused-vars 64 74 debug, 65 75 format, 66 76 type = 'unknown', ··· 104 114 105 115 const typeWithoutNamespace = decodeURIComponent(stripNamespace(type)); 106 116 107 - if (/\[.*\]$/g.test(typeWithoutNamespace)) { 117 + hasSquareBracketsRegExp.lastIndex = 0; 118 + if (hasSquareBracketsRegExp.test(typeWithoutNamespace)) { 108 119 const matches = typeWithoutNamespace.match(/(.*?)\[(.*)\]$/); 109 120 if (matches?.length) { 110 121 const match1 = getType({ 122 + debug, 111 123 type: ensureValidTypeScriptJavaScriptIdentifier(matches[1]), 112 124 }); 113 125 const match2 = getType({ 126 + debug, 114 127 type: ensureValidTypeScriptJavaScriptIdentifier(matches[2]), 115 128 }); 116 129
+4 -1
packages/openapi-ts/src/openApi/v3/parser/getModel.ts
··· 83 83 }; 84 84 85 85 if (definition.$ref) { 86 - const definitionRef = getType({ type: definition.$ref }); 86 + const definitionRef = getType({ 87 + debug, 88 + type: definition.$ref, 89 + }); 87 90 model.$refs = [...model.$refs, decodeURIComponent(definition.$ref)]; 88 91 model.base = definitionRef.base; 89 92 model.export = 'reference';
+3
packages/openapi-ts/src/plugins/@tanstack/query-core/plugin.ts
··· 620 620 let paginationField!: Model | OperationParameter; 621 621 622 622 const paginationParameter = operation.parameters.find((parameter) => { 623 + paginationWordsRegExp.lastIndex = 0; 623 624 if (paginationWordsRegExp.test(parameter.name)) { 624 625 paginationField = parameter; 625 626 return true; ··· 635 636 (model) => model.meta?.$ref === ref, 636 637 ); 637 638 return refModel?.properties.find((property) => { 639 + paginationWordsRegExp.lastIndex = 0; 638 640 if (paginationWordsRegExp.test(property.name)) { 639 641 paginationField = property; 640 642 return true; ··· 643 645 } 644 646 645 647 return parameter.properties.find((property) => { 648 + paginationWordsRegExp.lastIndex = 0; 646 649 if (paginationWordsRegExp.test(property.name)) { 647 650 paginationField = property; 648 651 return true;
+1
packages/openapi-ts/src/utils/escape.ts
··· 9 9 10 10 export const escapeName = (value: string): string => { 11 11 if (value || value === '') { 12 + validTypescriptIdentifierRegExp.lastIndex = 0; 12 13 const validName = validTypescriptIdentifierRegExp.test(value); 13 14 if (!validName) { 14 15 return `'${value}'`;
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-solid-query/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-svelte-query/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-vue-query/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-solid-query/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-svelte-query/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-vue-query/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+39 -2
packages/openapi-ts/test/__snapshots__/test/generated/v3-schemas-form/schemas.gen.ts.snap
··· 1777 1777 '$ref': '#/components/schemas/ConstValue' 1778 1778 }, 1779 1779 { 1780 - '$ref': '#/components/schemas/ModelWithBoolean' 1780 + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' 1781 1781 } 1782 1782 ] 1783 1783 }, ··· 1787 1787 ] 1788 1788 }, 1789 1789 { 1790 - '$ref': '#/components/schemas/import' 1790 + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' 1791 1791 } 1792 1792 ] 1793 + } as const; 1794 + 1795 + export const $Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1796 + type: 'object', 1797 + properties: { 1798 + item: { 1799 + type: 'boolean' 1800 + }, 1801 + error: { 1802 + type: 'string', 1803 + nullable: true 1804 + }, 1805 + hasError: { 1806 + type: 'boolean', 1807 + readOnly: true 1808 + } 1809 + }, 1810 + additionalProperties: false 1811 + } as const; 1812 + 1813 + export const $Generic_Schema_Duplicate_Issue_1_System_String_ = { 1814 + type: 'object', 1815 + properties: { 1816 + item: { 1817 + type: 'string', 1818 + nullable: true 1819 + }, 1820 + error: { 1821 + type: 'string', 1822 + nullable: true 1823 + }, 1824 + hasError: { 1825 + type: 'boolean', 1826 + readOnly: true 1827 + } 1828 + }, 1829 + additionalProperties: false 1793 1830 } as const;
+39 -2
packages/openapi-ts/test/__snapshots__/test/generated/v3-schemas-json/schemas.gen.ts.snap
··· 1937 1937 '$ref': '#/components/schemas/ConstValue' 1938 1938 }, 1939 1939 { 1940 - '$ref': '#/components/schemas/ModelWithBoolean' 1940 + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]' 1941 1941 } 1942 1942 ] 1943 1943 }, ··· 1947 1947 ] 1948 1948 }, 1949 1949 { 1950 - '$ref': '#/components/schemas/import' 1950 + '$ref': '#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]' 1951 1951 } 1952 1952 ] 1953 + } as const; 1954 + 1955 + export const $Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1956 + type: 'object', 1957 + properties: { 1958 + item: { 1959 + type: 'boolean' 1960 + }, 1961 + error: { 1962 + type: 'string', 1963 + nullable: true 1964 + }, 1965 + hasError: { 1966 + type: 'boolean', 1967 + readOnly: true 1968 + } 1969 + }, 1970 + additionalProperties: false 1971 + } as const; 1972 + 1973 + export const $Generic_Schema_Duplicate_Issue_1_System_String_ = { 1974 + type: 'object', 1975 + properties: { 1976 + item: { 1977 + type: 'string', 1978 + nullable: true 1979 + }, 1980 + error: { 1981 + type: 'string', 1982 + nullable: true 1983 + }, 1984 + hasError: { 1985 + type: 'boolean', 1986 + readOnly: true 1987 + } 1988 + }, 1989 + additionalProperties: false 1953 1990 } as const;
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3-types-PascalCase/types.gen.ts.snap
··· 939 939 [key: string]: (number) | undefined; 940 940 }; 941 941 942 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3eNum1Период) | Import; 942 + export type OneOfAllOfIssue = ((ConstValue | GenericSchemaDuplicateIssue1SystemBoolean) & _3eNum1Период) | GenericSchemaDuplicateIssue1SystemString; 943 + 944 + export type GenericSchemaDuplicateIssue_1_systemBoolean_ = { 945 + item?: boolean; 946 + error?: (string) | null; 947 + readonly hasError?: boolean; 948 + }; 949 + 950 + export type GenericSchemaDuplicateIssue_1_systemString_ = { 951 + item?: (string) | null; 952 + error?: (string) | null; 953 + readonly hasError?: boolean; 954 + }; 943 955 944 956 /** 945 957 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap
··· 939 939 [key: string]: (number) | undefined; 940 940 }; 941 941 942 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 942 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 943 + 944 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 945 + item?: boolean; 946 + error?: (string) | null; 947 + readonly hasError?: boolean; 948 + }; 949 + 950 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 951 + item?: (string) | null; 952 + error?: (string) | null; 953 + readonly hasError?: boolean; 954 + }; 943 955 944 956 /** 945 957 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap
··· 939 939 [key: string]: (number) | undefined; 940 940 }; 941 941 942 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 942 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 943 + 944 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 945 + item?: boolean; 946 + error?: (string) | null; 947 + readonly hasError?: boolean; 948 + }; 949 + 950 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 951 + item?: (string) | null; 952 + error?: (string) | null; 953 + readonly hasError?: boolean; 954 + }; 943 955 944 956 /** 945 957 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap
··· 1018 1018 [key: string]: (number) | undefined; 1019 1019 }; 1020 1020 1021 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1021 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1022 + 1023 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1024 + item?: boolean; 1025 + error?: (string) | null; 1026 + readonly hasError?: boolean; 1027 + }; 1028 + 1029 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1030 + item?: (string) | null; 1031 + error?: (string) | null; 1032 + readonly hasError?: boolean; 1033 + }; 1022 1034 1023 1035 /** 1024 1036 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript_namespace/types.gen.ts.snap
··· 1049 1049 [key: string]: (number) | undefined; 1050 1050 }; 1051 1051 1052 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1052 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1053 + 1054 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1055 + item?: boolean; 1056 + error?: (string) | null; 1057 + readonly hasError?: boolean; 1058 + }; 1059 + 1060 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1061 + item?: (string) | null; 1062 + error?: (string) | null; 1063 + readonly hasError?: boolean; 1064 + }; 1053 1065 1054 1066 /** 1055 1067 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_services_filter/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_services_name/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_types/types.gen.ts.snap
··· 939 939 [key: string]: (number) | undefined; 940 940 }; 941 941 942 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 942 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 943 + 944 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 945 + item?: boolean; 946 + error?: (string) | null; 947 + readonly hasError?: boolean; 948 + }; 949 + 950 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 951 + item?: (string) | null; 952 + error?: (string) | null; 953 + readonly hasError?: boolean; 954 + }; 943 955 944 956 /** 945 957 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_types_no_tree/types.gen.ts.snap
··· 939 939 [key: string]: (number) | undefined; 940 940 }; 941 941 942 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 942 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 943 + 944 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 945 + item?: boolean; 946 + error?: (string) | null; 947 + readonly hasError?: boolean; 948 + }; 949 + 950 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 951 + item?: (string) | null; 952 + error?: (string) | null; 953 + readonly hasError?: boolean; 954 + }; 943 955 944 956 /** 945 957 * This is a reusable parameter
+13 -1
packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap
··· 1062 1062 [key: string]: (number) | undefined; 1063 1063 }; 1064 1064 1065 - export type OneOfAllOfIssue = ((ConstValue | ModelWithBoolean) & _3e_num_1Период) | _import; 1065 + export type OneOfAllOfIssue = ((ConstValue | Generic_Schema_Duplicate_Issue_1_System_Boolean_) & _3e_num_1Период) | Generic_Schema_Duplicate_Issue_1_System_String_; 1066 + 1067 + export type Generic_Schema_Duplicate_Issue_1_System_Boolean_ = { 1068 + item?: boolean; 1069 + error?: (string) | null; 1070 + readonly hasError?: boolean; 1071 + }; 1072 + 1073 + export type Generic_Schema_Duplicate_Issue_1_System_String_ = { 1074 + item?: (string) | null; 1075 + error?: (string) | null; 1076 + readonly hasError?: boolean; 1077 + }; 1066 1078 1067 1079 /** 1068 1080 * This is a reusable parameter
+37 -2
packages/openapi-ts/test/spec/v3.json
··· 3526 3526 "$ref": "#/components/schemas/ConstValue" 3527 3527 }, 3528 3528 { 3529 - "$ref": "#/components/schemas/ModelWithBoolean" 3529 + "$ref": "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.Boolean]" 3530 3530 } 3531 3531 ] 3532 3532 }, ··· 3536 3536 ] 3537 3537 }, 3538 3538 { 3539 - "$ref": "#/components/schemas/import" 3539 + "$ref": "#/components/schemas/Generic.Schema.Duplicate.Issue`1[System.String]" 3540 3540 } 3541 3541 ] 3542 + }, 3543 + "Generic.Schema.Duplicate.Issue`1[System.Boolean]": { 3544 + "type": "object", 3545 + "properties": { 3546 + "item": { 3547 + "type": "boolean" 3548 + }, 3549 + "error": { 3550 + "type": "string", 3551 + "nullable": true 3552 + }, 3553 + "hasError": { 3554 + "type": "boolean", 3555 + "readOnly": true 3556 + } 3557 + }, 3558 + "additionalProperties": false 3559 + }, 3560 + "Generic.Schema.Duplicate.Issue`1[System.String]": { 3561 + "type": "object", 3562 + "properties": { 3563 + "item": { 3564 + "type": "string", 3565 + "nullable": true 3566 + }, 3567 + "error": { 3568 + "type": "string", 3569 + "nullable": true 3570 + }, 3571 + "hasError": { 3572 + "type": "boolean", 3573 + "readOnly": true 3574 + } 3575 + }, 3576 + "additionalProperties": false 3542 3577 } 3543 3578 } 3544 3579 }