Skip to content

Commit

Permalink
fixed timeout name collision
Browse files Browse the repository at this point in the history
  • Loading branch information
JBBianchi committed Sep 4, 2024
1 parent cf1d42c commit e7e49d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/2_generate-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ function prepareSchema(schema: any, path: string[] = ['#'], parentTitle: string
if (parentTitle.trim()) {
const title = !isItemWithAdditionalProperties ? parent : path.includes('switch') ? 'case' : 'item';
newSchema.title = toPascalCase(`${parentTitle} ${title}`);
}
if (path.join('/') == '#/properties/timeout') {
newSchema.title = 'WorkflowTimeout';
} else {
newSchema.title = toPascalCase(
path
Expand Down Expand Up @@ -181,6 +184,7 @@ function mutateSchema(schema: any, path: string[] = ['#']): any {
*/
async function generate(srcFile: string, destFile: string): Promise<void> {
const options: Partial<Options> = {
// prefere `prepareSchema` to set a title rather than `customName` otherwise the next step (validation pointers generation) will fail
customName: (schema: JSONSchema) /*, keyNameFromDefinition: string | undefined)*/ => {
if (schema.$id?.includes('serverlessworkflow.io')) {
return 'Workflow';
Expand Down

0 comments on commit e7e49d5

Please sign in to comment.