Skip to content

Commit cf1d42c

Browse files
committed
Fixed custom name function used when generating types
Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
1 parent 9d4748c commit cf1d42c

File tree

3 files changed

+7
-195
lines changed

3 files changed

+7
-195
lines changed

package-lock.json

+4-188
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"eslint-plugin-prettier": "^5.1.3",
5757
"husky": "^9.0.11",
5858
"jest": "^29.7.0",
59-
"json-schema-to-typescript": "^15.0.0",
59+
"json-schema-to-typescript": "^15.0.1",
6060
"lint-staged": "^15.2.7",
6161
"node-fetch": "^3.3.2",
6262
"prettier": "^3.3.3",

tools/2_generate-definitions.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,11 @@ function mutateSchema(schema: any, path: string[] = ['#']): any {
181181
*/
182182
async function generate(srcFile: string, destFile: string): Promise<void> {
183183
const options: Partial<Options> = {
184-
customName: (schema: JSONSchema, keyNameFromDefinition: string | undefined) => {
184+
customName: (schema: JSONSchema) /*, keyNameFromDefinition: string | undefined)*/ => {
185185
if (schema.$id?.includes('serverlessworkflow.io')) {
186186
return 'Workflow';
187187
}
188-
if (keyNameFromDefinition === 'oauth2Token') {
189-
// seems to ignore the title from this object, so forcing it...
190-
return schema.title;
191-
}
192-
return keyNameFromDefinition;
188+
// don't return anything to keep the default behavior
193189
},
194190
bannerComment: `${fileHeader}
195191
${inFileDisclaimer}

0 commit comments

Comments
 (0)