Skip to content

Commit

Permalink
chore: rename default if/else title
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVarchuk committed May 16, 2022
1 parent b2c4c11 commit a9c3599
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/services/__tests__/models/Schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Models', () => {
expect(schema.oneOf).toHaveLength(2);

expect(schema.oneOf![0].schema.title).toBe('=== 10');
expect(schema.oneOf![1].schema.title).toBe('else');
expect(schema.oneOf![1].schema.title).toBe('case 2');

expect(schema.oneOf![0].schema).toMatchSnapshot();
expect(schema.oneOf![1].schema).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Object {
],
},
},
"title": "else",
"title": "case 2",
"type": "object",
}
`;
5 changes: 3 additions & 2 deletions src/services/models/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,11 @@ export class SchemaModel {
const groupedOperators = [
{
allOf: [restSchema, thenOperator, ifOperator],
title: (ifOperator && ifOperator['x-displayName']) || ifOperator?.title || 'if',
title: (ifOperator && ifOperator['x-displayName']) || ifOperator?.title || 'case 1',
},
{
allOf: [restSchema, elseOperator],
title: (elseOperator && elseOperator['x-displayName']) || elseOperator?.title || 'else',
title: (elseOperator && elseOperator['x-displayName']) || elseOperator?.title || 'case 2',
},
];

Expand All @@ -390,6 +390,7 @@ export class SchemaModel {
this.options,
),
);
this.oneOfType = 'One of';
}
}

Expand Down

0 comments on commit a9c3599

Please sign in to comment.