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 #881 from hougesen/fix/openapi-ts/schemas.type-form-check-if-schema-property

authored by

Lubos and committed by
GitHub
e6e67141 9e34adb4

+1143 -3
+5
.changeset/fuzzy-years-unite.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + fix: check if key is schema property before removing
+7 -3
packages/openapi-ts/src/generate/schemas.ts
··· 4 4 import type { Files } from '../types/utils'; 5 5 import { getConfig } from '../utils/config'; 6 6 7 - const ensureValidSchemaOutput = (schema: unknown): object => { 7 + const ensureValidSchemaOutput = ( 8 + schema: unknown, 9 + parentKey?: string, 10 + ): object => { 8 11 const config = getConfig(); 9 12 10 13 if (Array.isArray(schema)) { ··· 25 28 'x-enum-varnames', 26 29 'x-enumNames', 27 30 'title', 28 - ].includes(key) 31 + ].includes(key) && 32 + parentKey !== 'properties' 29 33 ) { 30 34 // @ts-ignore 31 35 delete result[key]; ··· 42 46 43 47 if (value && typeof value === 'object') { 44 48 // @ts-ignore 45 - result[key] = ensureValidSchemaOutput(value); 49 + result[key] = ensureValidSchemaOutput(value, key); 46 50 } 47 51 }); 48 52 return result;
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_angular/types.gen.ts.snap
··· 874 874 */ 875 875 export type _import = string; 876 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 + 877 899 /** 878 900 * This is a reusable parameter 879 901 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_axios/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_client/types.gen.ts.snap
··· 874 874 */ 875 875 export type _import = string; 876 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 + 877 899 /** 878 900 * This is a reusable parameter 879 901 */
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript/types.gen.ts.snap
··· 953 953 */ 954 954 export type _import = string; 955 955 956 + export type SchemaWithFormRestrictedKeys = { 957 + description?: string; 958 + 'x-enum-descriptions'?: string; 959 + 'x-enum-varnames'?: string; 960 + 'x-enumNames'?: string; 961 + title?: string; 962 + object?: { 963 + description?: string; 964 + 'x-enum-descriptions'?: string; 965 + 'x-enum-varnames'?: string; 966 + 'x-enumNames'?: string; 967 + title?: string; 968 + }; 969 + array?: Array<({ 970 + description?: string; 971 + 'x-enum-descriptions'?: string; 972 + 'x-enum-varnames'?: string; 973 + 'x-enumNames'?: string; 974 + title?: string; 975 + })>; 976 + }; 977 + 956 978 /** 957 979 * This is a reusable parameter 958 980 */
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_enums_typescript_namespace/types.gen.ts.snap
··· 984 984 */ 985 985 export type _import = string; 986 986 987 + export type SchemaWithFormRestrictedKeys = { 988 + description?: string; 989 + 'x-enum-descriptions'?: string; 990 + 'x-enum-varnames'?: string; 991 + 'x-enumNames'?: string; 992 + title?: string; 993 + object?: { 994 + description?: string; 995 + 'x-enum-descriptions'?: string; 996 + 'x-enum-varnames'?: string; 997 + 'x-enumNames'?: string; 998 + title?: string; 999 + }; 1000 + array?: Array<({ 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + })>; 1007 + }; 1008 + 987 1009 /** 988 1010 * This is a reusable parameter 989 1011 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-axios/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-axios/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-axios_bundle/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-axios_bundle/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_bundle/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_bundle/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_hey-api_client-fetch_plugin_tanstack-react-query/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_node/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_node/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_schemas_form/schemas.gen.ts.snap
··· 1613 1613 1614 1614 export const $import = { 1615 1615 type: 'string' 1616 + } as const; 1617 + 1618 + export const $SchemaWithFormRestrictedKeys = { 1619 + properties: { 1620 + description: { 1621 + type: 'string' 1622 + }, 1623 + 'x-enum-descriptions': { 1624 + type: 'string' 1625 + }, 1626 + 'x-enum-varnames': { 1627 + type: 'string' 1628 + }, 1629 + 'x-enumNames': { 1630 + type: 'string' 1631 + }, 1632 + title: { 1633 + type: 'string' 1634 + }, 1635 + object: { 1636 + type: 'object', 1637 + properties: { 1638 + description: { 1639 + type: 'string' 1640 + }, 1641 + 'x-enum-descriptions': { 1642 + type: 'string' 1643 + }, 1644 + 'x-enum-varnames': { 1645 + type: 'string' 1646 + }, 1647 + 'x-enumNames': { 1648 + type: 'string' 1649 + }, 1650 + title: { 1651 + type: 'string' 1652 + } 1653 + } 1654 + }, 1655 + array: { 1656 + type: 'array', 1657 + items: [ 1658 + { 1659 + type: 'object', 1660 + properties: { 1661 + description: { 1662 + type: 'string' 1663 + }, 1664 + 'x-enum-descriptions': { 1665 + type: 'string' 1666 + }, 1667 + 'x-enum-varnames': { 1668 + type: 'string' 1669 + }, 1670 + 'x-enumNames': { 1671 + type: 'string' 1672 + }, 1673 + title: { 1674 + type: 'string' 1675 + } 1676 + } 1677 + } 1678 + ] 1679 + } 1680 + } 1616 1681 } as const;
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_schemas_json/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_tree_shakeable/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_types/types.gen.ts.snap
··· 874 874 */ 875 875 export type _import = string; 876 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 + 877 899 /** 878 900 * This is a reusable parameter 879 901 */
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_types_no_tree/types.gen.ts.snap
··· 874 874 */ 875 875 export type _import = string; 876 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 + 877 899 /** 878 900 * This is a reusable parameter 879 901 */
+65
packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/schemas.gen.ts.snap
··· 1768 1768 export const $import = { 1769 1769 description: 'Model with restricted keyword name', 1770 1770 type: 'string' 1771 + } as const; 1772 + 1773 + export const $SchemaWithFormRestrictedKeys = { 1774 + properties: { 1775 + description: { 1776 + type: 'string' 1777 + }, 1778 + 'x-enum-descriptions': { 1779 + type: 'string' 1780 + }, 1781 + 'x-enum-varnames': { 1782 + type: 'string' 1783 + }, 1784 + 'x-enumNames': { 1785 + type: 'string' 1786 + }, 1787 + title: { 1788 + type: 'string' 1789 + }, 1790 + object: { 1791 + type: 'object', 1792 + properties: { 1793 + description: { 1794 + type: 'string' 1795 + }, 1796 + 'x-enum-descriptions': { 1797 + type: 'string' 1798 + }, 1799 + 'x-enum-varnames': { 1800 + type: 'string' 1801 + }, 1802 + 'x-enumNames': { 1803 + type: 'string' 1804 + }, 1805 + title: { 1806 + type: 'string' 1807 + } 1808 + } 1809 + }, 1810 + array: { 1811 + type: 'array', 1812 + items: [ 1813 + { 1814 + type: 'object', 1815 + properties: { 1816 + description: { 1817 + type: 'string' 1818 + }, 1819 + 'x-enum-descriptions': { 1820 + type: 'string' 1821 + }, 1822 + 'x-enum-varnames': { 1823 + type: 'string' 1824 + }, 1825 + 'x-enumNames': { 1826 + type: 'string' 1827 + }, 1828 + title: { 1829 + type: 'string' 1830 + } 1831 + } 1832 + } 1833 + ] 1834 + } 1835 + } 1771 1836 } as const;
+22
packages/openapi-ts/test/__snapshots__/test/generated/v3_xhr/types.gen.ts.snap
··· 997 997 */ 998 998 export type _import = string; 999 999 1000 + export type SchemaWithFormRestrictedKeys = { 1001 + description?: string; 1002 + 'x-enum-descriptions'?: string; 1003 + 'x-enum-varnames'?: string; 1004 + 'x-enumNames'?: string; 1005 + title?: string; 1006 + object?: { 1007 + description?: string; 1008 + 'x-enum-descriptions'?: string; 1009 + 'x-enum-varnames'?: string; 1010 + 'x-enumNames'?: string; 1011 + title?: string; 1012 + }; 1013 + array?: Array<({ 1014 + description?: string; 1015 + 'x-enum-descriptions'?: string; 1016 + 'x-enum-varnames'?: string; 1017 + 'x-enumNames'?: string; 1018 + title?: string; 1019 + })>; 1020 + }; 1021 + 1000 1022 /** 1001 1023 * This is a reusable parameter 1002 1024 */
+64
packages/openapi-ts/test/spec/v3.json
··· 3343 3343 "400": { 3344 3344 "description": "Model with number-only name", 3345 3345 "type": "string" 3346 + }, 3347 + "SchemaWithFormRestrictedKeys": { 3348 + "properties": { 3349 + "description": { 3350 + "type": "string" 3351 + }, 3352 + "x-enum-descriptions": { 3353 + "type": "string" 3354 + }, 3355 + "x-enum-varnames": { 3356 + "type": "string" 3357 + }, 3358 + "x-enumNames": { 3359 + "type": "string" 3360 + }, 3361 + "title": { 3362 + "type": "string" 3363 + }, 3364 + "object": { 3365 + "type": "object", 3366 + "properties": { 3367 + "description": { 3368 + "type": "string" 3369 + }, 3370 + "x-enum-descriptions": { 3371 + "type": "string" 3372 + }, 3373 + "x-enum-varnames": { 3374 + "type": "string" 3375 + }, 3376 + "x-enumNames": { 3377 + "type": "string" 3378 + }, 3379 + "title": { 3380 + "type": "string" 3381 + } 3382 + } 3383 + }, 3384 + "array": { 3385 + "type": "array", 3386 + "items": [ 3387 + { 3388 + "type": "object", 3389 + "properties": { 3390 + "description": { 3391 + "type": "string" 3392 + }, 3393 + "x-enum-descriptions": { 3394 + "type": "string" 3395 + }, 3396 + "x-enum-varnames": { 3397 + "type": "string" 3398 + }, 3399 + "x-enumNames": { 3400 + "type": "string" 3401 + }, 3402 + "title": { 3403 + "type": "string" 3404 + } 3405 + } 3406 + } 3407 + ] 3408 + } 3409 + } 3346 3410 } 3347 3411 } 3348 3412 }