-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from overture-stack/bug_nested_restriction
bug fix - nested restrictions
- Loading branch information
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...t/fixtures/fields/conditionalRestrictions/fieldStringConditionalExistsWithouthThenElse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { SchemaField, type SchemaStringField } from '@overture-stack/lectern-dictionary'; | ||
import { fieldStringNoRestriction } from '../noRestrictions/fieldStringNoRestriction'; | ||
import { validateFixture } from '../../../testUtils/validateFixture'; | ||
|
||
export const fieldStringConditionalExistsWithouthThenElse = { | ||
name: 'conditional-field', | ||
valueType: 'string', | ||
description: 'Required if `fieldStringNoRestriction` field exists, otherwise must be empty', | ||
restrictions: { | ||
if: { | ||
conditions: [ | ||
{ | ||
fields: [fieldStringNoRestriction.name], | ||
match: { | ||
exists: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
} as const satisfies SchemaStringField; | ||
|
||
validateFixture( | ||
fieldStringConditionalExistsWithouthThenElse, | ||
SchemaField, | ||
'fieldStringConditionalExistsWithouthThenElse is not a valid SchemaField', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters