You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like use the tsEnumNames property when defining the items property of an array of enum values; however it fails.
If it's not a supported use case, then it would be nice to put this in the documentation.
TypeError: Cannot read properties of undefined (reading 'endsWith')
at /Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/dist/src/generator.js:161:29
at generateRawType (/Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/dist/src/generator.js:162:15)
at generateTypeUnmemoized (/Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/dist/src/generator.js:143:16)
at memoized (/Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/node_modules/lodash/lodash.js:10620:27)
at /Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/dist/src/generator.js:273:72
at Array.map (<anonymous>)
at generateInterface (/Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/dist/src/generator.js:271:14)
at generateStandaloneInterface (/Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/dist/src/generator.js:309:9)
at declareNamedInterfaces (/Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/dist/src/generator.js:71:21)
at generate (/Users/<username>/Library/Application Support/fnm/node-versions/v18.12.1/installation/lib/node_modules/json-schema-to-typescript/dist/src/generator.js:22:9)
]
The text was updated successfully, but these errors were encountered:
bcherny
changed the title
Array of enums is not compatible with tsEnumNames
Unnamed enums in array items throw
Jun 10, 2023
I would like use the tsEnumNames property when defining the items property of an array of enum values; however it fails.
If it's not a supported use case, then it would be nice to put this in the documentation.
Example schema:
results in the following error:
The text was updated successfully, but these errors were encountered: