Closed macdermott closed 1 year ago
Hey @macdermott,
There is a new sortConfig
option which is why it fails on your end. I've made the config optional in the latest version.
You could also fix it by providing the option such as:
await generateModelsAsync({
sdkType: 'delivery',
environmentId: 'x',
isEnterpriseSubscription: true,
apiKey: 'yyy',
addTimestamp: true,
elementResolver: 'camelCase',
sortConfig: {
sortTaxonomyTerms: true
}
})
This worked perfectly. Thank you!
Brief bug description
Unable to generate models when calling generateModelsAsync - the error "Cannot read properties of undefined (reading 'sortTaxonomyTerms')" is thrown. v6.2.0 works with the same call to generateModelsAsync.
Repro steps
TypeError: Cannot read properties of undefined (reading 'sortTaxonomyTerms') at ProjectGenerator.getProjectTaxonomiesTerms (/Users/ged/project/node_modules/@kontent-ai/model-generator/dist/cjs/lib/generators/project/project.generator.js:467:40) at ProjectGenerator.getProjectTaxonomies (/Users/ged/project/node_modules/@kontent-ai/model-generator/dist/cjs/lib/generators/project/project.generator.js:413:24) at ProjectGenerator.getProjectModelCode (/Users/ged/project/node_modules/@kontent-ai/model-generator/dist/cjs/lib/generators/project/project.generator.js:166:28) at ProjectGenerator.generateProjectModel (/Users/ged/project/node_modules/@kontent-ai/model-generator/dist/cjs/lib/generators/project/project.generator.js:9:35) at /Users/ged/project/node_modules/@kontent-ai/model-generator/dist/cjs/lib/generator.js:138:74 at Generator.next ()
at fulfilled (/Users/ged/project/node_modules/@kontent-ai/model-generator/dist/cjs/lib/generator.js:5:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)`