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 #929 from hey-api/fix/additional-properties-unknown

fix: handle various issues with additionalProperties definitions

authored by

Lubos and committed by
GitHub
5b2898c9 76228dae

+589 -17
+5
.changeset/silly-seals-taste.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: handle various issues with additionalProperties definitions
+1
packages/openapi-ts/src/openApi/v3/interfaces/Model.ts
··· 5 5 6 6 export type GetModelFn = ( 7 7 args: Pick<Client, 'types'> & { 8 + debug?: boolean; 8 9 definition: OpenApiSchema; 9 10 /** 10 11 * Pass through initial model values
+15 -3
packages/openapi-ts/src/openApi/v3/parser/getModel.ts
··· 22 22 } from './inferType'; 23 23 24 24 export const getModel = ({ 25 - // eslint-disable-next-line @typescript-eslint/no-unused-vars 26 25 debug, 27 26 definition, 28 27 initialValues = {}, ··· 207 206 if (foundComposition) { 208 207 const composition = getModelComposition({ 209 208 ...foundComposition, 209 + debug, 210 210 definition, 211 211 getModel, 212 212 model, ··· 216 216 return { ...model, ...composition }; 217 217 } 218 218 219 - if (definitionTypes.includes('object') || definition.properties) { 220 - if (definition.properties) { 219 + if ( 220 + definitionTypes.includes('object') || 221 + definition.properties || 222 + definition.additionalProperties 223 + ) { 224 + if ( 225 + definition.properties && 226 + !( 227 + !Object.keys(definition.properties).length && 228 + definition.additionalProperties 229 + ) 230 + ) { 221 231 model.base = 'unknown'; 222 232 model.export = 'interface'; 223 233 model.type = 'unknown'; 224 234 model.default = getDefault(definition, model); 225 235 226 236 const modelProperties = getModelProperties({ 237 + debug, 227 238 definition, 228 239 getModel, 229 240 openApi, ··· 265 276 } 266 277 267 278 return getAdditionalPropertiesModel({ 279 + debug, 268 280 definition, 269 281 getModel, 270 282 model,
+3
packages/openapi-ts/src/openApi/v3/parser/getModelComposition.ts
··· 37 37 }; 38 38 39 39 export const getModelComposition = ({ 40 + debug, 40 41 definition, 41 42 definitions, 42 43 getModel, ··· 46 47 types, 47 48 }: Composition & 48 49 Pick<Client, 'types'> & { 50 + debug?: boolean; 49 51 definition: OpenApiSchema; 50 52 getModel: GetModelFn; 51 53 model: Model; ··· 64 66 definitions 65 67 .map((def) => { 66 68 const modelFromDef = getModel({ 69 + debug, 67 70 definition: def, 68 71 openApi, 69 72 parentDefinition: definition,
+27 -12
packages/openapi-ts/src/openApi/v3/parser/getModelProperties.ts
··· 15 15 import { isDefinitionNullable } from './inferType'; 16 16 17 17 export const getAdditionalPropertiesModel = ({ 18 + debug, 18 19 definition, 19 20 getModel, 20 21 model, 21 22 openApi, 22 23 types, 23 24 }: { 25 + debug?: boolean; 24 26 definition: OpenApiSchema; 25 27 getModel: GetModelFn; 26 28 model: Model; ··· 32 34 ? definition.additionalProperties 33 35 : {}; 34 36 const apModel = getModel({ 37 + debug, 35 38 definition: ap, 36 39 openApi, 37 40 parentDefinition: definition, ··· 49 52 return model; 50 53 } 51 54 52 - if (definition.additionalProperties && definition.properties) { 55 + if ( 56 + definition.additionalProperties && 57 + definition.properties && 58 + Object.keys(definition.properties).length 59 + ) { 53 60 const additionalPropertiesType = 54 61 typeof definition.additionalProperties === 'object' && 55 62 definition.additionalProperties.type && ··· 79 86 }; 80 87 81 88 export const getModelProperties = ({ 89 + debug, 82 90 definition, 83 91 getModel, 84 92 openApi, 85 93 parent, 86 94 types, 87 95 }: { 96 + debug?: boolean; 88 97 definition: OpenApiSchema; 89 98 getModel: GetModelFn; 90 99 openApi: OpenApi; ··· 99 108 const propertyRequired = Boolean( 100 109 definition.required?.includes(propertyName), 101 110 ); 111 + 102 112 const propertyValues: Omit< 103 113 Model, 104 114 | '$refs' ··· 158 168 type: 'string', 159 169 }, 160 170 ]; 161 - } else if (property.$ref) { 171 + return; 172 + } 173 + 174 + if (property.$ref) { 162 175 const model = getType({ type: property.$ref }); 163 176 models = [ 164 177 ...models, ··· 177 190 type: model.type, 178 191 }, 179 192 ]; 180 - } else { 181 - const model = getModel({ 182 - definition: property, 183 - initialValues: propertyValues, 184 - openApi, 185 - parentDefinition: definition, 186 - types, 187 - }); 188 - model.isNullable = model.isNullable || isDefinitionNullable(property); 189 - models = [...models, model]; 193 + return; 190 194 } 195 + 196 + const model = getModel({ 197 + debug, 198 + definition: property, 199 + initialValues: propertyValues, 200 + openApi, 201 + parentDefinition: definition, 202 + types, 203 + }); 204 + model.isNullable = model.isNullable || isDefinitionNullable(property); 205 + models = [...models, model]; 191 206 }, 192 207 ); 193 208
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-bundle/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-class/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-react-query/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-solid-query/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-svelte-query/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios-plugin-tanstack-vue-query/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-axios/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-bundle/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-class/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-react-query/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-solid-query/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-svelte-query/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch-plugin-tanstack-vue-query/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-hey-api-client-fetch/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+49
packages/openapi-ts/test/__snapshots__/test/generated/v3-schemas-form/schemas.gen.ts.snap
··· 1703 1703 } 1704 1704 }, 1705 1705 type: 'object' 1706 + } as const; 1707 + 1708 + export const $AdditionalPropertiesUnknownIssue = { 1709 + type: 'object', 1710 + properties: {}, 1711 + additionalProperties: { 1712 + anyOf: [ 1713 + { 1714 + type: 'string' 1715 + }, 1716 + { 1717 + type: 'number' 1718 + } 1719 + ] 1720 + } 1721 + } as const; 1722 + 1723 + export const $AdditionalPropertiesUnknownIssue2 = { 1724 + type: 'object', 1725 + additionalProperties: { 1726 + anyOf: [ 1727 + { 1728 + type: 'string' 1729 + }, 1730 + { 1731 + type: 'number' 1732 + } 1733 + ] 1734 + } 1735 + } as const; 1736 + 1737 + export const $AdditionalPropertiesUnknownIssue3 = { 1738 + type: 'object', 1739 + allOf: [ 1740 + { 1741 + type: 'string' 1742 + }, 1743 + { 1744 + type: 'object', 1745 + required: ['entries'], 1746 + properties: { 1747 + entries: { 1748 + additionalProperties: { 1749 + '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' 1750 + } 1751 + } 1752 + } 1753 + } 1754 + ] 1706 1755 } as const;
+49
packages/openapi-ts/test/__snapshots__/test/generated/v3-schemas-json/schemas.gen.ts.snap
··· 1863 1863 } 1864 1864 }, 1865 1865 type: 'object' 1866 + } as const; 1867 + 1868 + export const $AdditionalPropertiesUnknownIssue = { 1869 + type: 'object', 1870 + properties: {}, 1871 + additionalProperties: { 1872 + anyOf: [ 1873 + { 1874 + type: 'string' 1875 + }, 1876 + { 1877 + type: 'number' 1878 + } 1879 + ] 1880 + } 1881 + } as const; 1882 + 1883 + export const $AdditionalPropertiesUnknownIssue2 = { 1884 + type: 'object', 1885 + additionalProperties: { 1886 + anyOf: [ 1887 + { 1888 + type: 'string' 1889 + }, 1890 + { 1891 + type: 'number' 1892 + } 1893 + ] 1894 + } 1895 + } as const; 1896 + 1897 + export const $AdditionalPropertiesUnknownIssue3 = { 1898 + type: 'object', 1899 + allOf: [ 1900 + { 1901 + type: 'string' 1902 + }, 1903 + { 1904 + type: 'object', 1905 + required: ['entries'], 1906 + properties: { 1907 + entries: { 1908 + additionalProperties: { 1909 + '$ref': '#/components/schemas/AdditionalPropertiesUnknownIssue' 1910 + } 1911 + } 1912 + } 1913 + } 1914 + ] 1866 1915 } as const;
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3-types-PascalCase/types.gen.ts.snap
··· 920 920 uid?: string; 921 921 }; 922 922 923 + export type AdditionalPropertiesUnknownIssue = { 924 + [key: string]: (string | number); 925 + }; 926 + 927 + export type AdditionalPropertiesUnknownIssue2 = { 928 + [key: string]: (string | number); 929 + }; 930 + 931 + export type AdditionalPropertiesUnknownIssue3 = string & { 932 + entries: { 933 + [key: string]: AdditionalPropertiesUnknownIssue; 934 + }; 935 + }; 936 + 923 937 /** 924 938 * This is a reusable parameter 925 939 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap
··· 920 920 uid?: string; 921 921 }; 922 922 923 + export type AdditionalPropertiesUnknownIssue = { 924 + [key: string]: (string | number); 925 + }; 926 + 927 + export type AdditionalPropertiesUnknownIssue2 = { 928 + [key: string]: (string | number); 929 + }; 930 + 931 + export type AdditionalPropertiesUnknownIssue3 = string & { 932 + entries: { 933 + [key: string]: AdditionalPropertiesUnknownIssue; 934 + }; 935 + }; 936 + 923 937 /** 924 938 * This is a reusable parameter 925 939 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap
··· 920 920 uid?: string; 921 921 }; 922 922 923 + export type AdditionalPropertiesUnknownIssue = { 924 + [key: string]: (string | number); 925 + }; 926 + 927 + export type AdditionalPropertiesUnknownIssue2 = { 928 + [key: string]: (string | number); 929 + }; 930 + 931 + export type AdditionalPropertiesUnknownIssue3 = string & { 932 + entries: { 933 + [key: string]: AdditionalPropertiesUnknownIssue; 934 + }; 935 + }; 936 + 923 937 /** 924 938 * This is a reusable parameter 925 939 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap
··· 999 999 uid?: string; 1000 1000 }; 1001 1001 1002 + export type AdditionalPropertiesUnknownIssue = { 1003 + [key: string]: (string | number); 1004 + }; 1005 + 1006 + export type AdditionalPropertiesUnknownIssue2 = { 1007 + [key: string]: (string | number); 1008 + }; 1009 + 1010 + export type AdditionalPropertiesUnknownIssue3 = string & { 1011 + entries: { 1012 + [key: string]: AdditionalPropertiesUnknownIssue; 1013 + }; 1014 + }; 1015 + 1002 1016 /** 1003 1017 * This is a reusable parameter 1004 1018 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript_namespace/types.gen.ts.snap
··· 1030 1030 uid?: string; 1031 1031 }; 1032 1032 1033 + export type AdditionalPropertiesUnknownIssue = { 1034 + [key: string]: (string | number); 1035 + }; 1036 + 1037 + export type AdditionalPropertiesUnknownIssue2 = { 1038 + [key: string]: (string | number); 1039 + }; 1040 + 1041 + export type AdditionalPropertiesUnknownIssue3 = string & { 1042 + entries: { 1043 + [key: string]: AdditionalPropertiesUnknownIssue; 1044 + }; 1045 + }; 1046 + 1033 1047 /** 1034 1048 * This is a reusable parameter 1035 1049 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_services_filter/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_services_name/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_types/types.gen.ts.snap
··· 920 920 uid?: string; 921 921 }; 922 922 923 + export type AdditionalPropertiesUnknownIssue = { 924 + [key: string]: (string | number); 925 + }; 926 + 927 + export type AdditionalPropertiesUnknownIssue2 = { 928 + [key: string]: (string | number); 929 + }; 930 + 931 + export type AdditionalPropertiesUnknownIssue3 = string & { 932 + entries: { 933 + [key: string]: AdditionalPropertiesUnknownIssue; 934 + }; 935 + }; 936 + 923 937 /** 924 938 * This is a reusable parameter 925 939 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_types_no_tree/types.gen.ts.snap
··· 920 920 uid?: string; 921 921 }; 922 922 923 + export type AdditionalPropertiesUnknownIssue = { 924 + [key: string]: (string | number); 925 + }; 926 + 927 + export type AdditionalPropertiesUnknownIssue2 = { 928 + [key: string]: (string | number); 929 + }; 930 + 931 + export type AdditionalPropertiesUnknownIssue3 = string & { 932 + entries: { 933 + [key: string]: AdditionalPropertiesUnknownIssue; 934 + }; 935 + }; 936 + 923 937 /** 924 938 * This is a reusable parameter 925 939 */
+14
packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap
··· 1043 1043 uid?: string; 1044 1044 }; 1045 1045 1046 + export type AdditionalPropertiesUnknownIssue = { 1047 + [key: string]: (string | number); 1048 + }; 1049 + 1050 + export type AdditionalPropertiesUnknownIssue2 = { 1051 + [key: string]: (string | number); 1052 + }; 1053 + 1054 + export type AdditionalPropertiesUnknownIssue3 = string & { 1055 + entries: { 1056 + [key: string]: AdditionalPropertiesUnknownIssue; 1057 + }; 1058 + }; 1059 + 1046 1060 /** 1047 1061 * This is a reusable parameter 1048 1062 */
+2 -2
packages/openapi-ts/test/sample.cjs
··· 8 8 // // name: '@hey-api/client-axios', 9 9 // name: '@hey-api/client-fetch', 10 10 // }, 11 - debug: true, 11 + // debug: true, 12 12 // input: './test/spec/v3-transforms.json', 13 13 input: './test/spec/v3.json', 14 14 // input: './test/spec/v2.json', ··· 42 42 // include: 43 43 // '^(_400|CompositionWithOneOfAndProperties)', 44 44 // name: 'PascalCase', 45 - // tree: false, 45 + tree: false, 46 46 }, 47 47 // useOptions: false, 48 48 };
+46
packages/openapi-ts/test/spec/v3.json
··· 3457 3457 } 3458 3458 }, 3459 3459 "type": "object" 3460 + }, 3461 + "AdditionalPropertiesUnknownIssue": { 3462 + "type": "object", 3463 + "properties": {}, 3464 + "additionalProperties": { 3465 + "anyOf": [ 3466 + { 3467 + "type": "string" 3468 + }, 3469 + { 3470 + "type": "number" 3471 + } 3472 + ] 3473 + } 3474 + }, 3475 + "AdditionalPropertiesUnknownIssue2": { 3476 + "type": "object", 3477 + "additionalProperties": { 3478 + "anyOf": [ 3479 + { 3480 + "type": "string" 3481 + }, 3482 + { 3483 + "type": "number" 3484 + } 3485 + ] 3486 + } 3487 + }, 3488 + "AdditionalPropertiesUnknownIssue3": { 3489 + "type": "object", 3490 + "allOf": [ 3491 + { 3492 + "type": "string" 3493 + }, 3494 + { 3495 + "type": "object", 3496 + "required": ["entries"], 3497 + "properties": { 3498 + "entries": { 3499 + "additionalProperties": { 3500 + "$ref": "#/components/schemas/AdditionalPropertiesUnknownIssue" 3501 + } 3502 + } 3503 + } 3504 + } 3505 + ] 3460 3506 } 3461 3507 } 3462 3508 }