Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle incompatible keyword in haddock3 yaml files #160

Merged
merged 11 commits into from
Aug 23, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* Hook useSaveWithGlobalRewrite() ([#161](https://github.com/i-VRESSE/workflow-builder/pull/161))
* Support for if/then/else in JSON schema ([#160](https://github.com/i-VRESSE/workflow-builder/pull/160))

## @i-vresse/wb-core 3.0.1 - 2024-05-23

Expand Down
24 changes: 24 additions & 0 deletions docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,27 @@ and `abcd.pdb` file has chain A and B with residues 1, 2, 3 and 4.

Then the form will have restricted the `chain` prop to only allow `A` and `B`
and will have restricted the sta and end prop to only allow 1, 2, 3 and 4.

## If then else

The `if`, `then` and `else` keywords can be used to [conditionally apply a schema](https://json-schema.org/understanding-json-schema/reference/conditionals#ifthenelse).

For example to have the `foo` property only if the `bar` property is false use:

```yaml
type: object
properties:
bar:
type: boolean
if:
properties:
bar:
const: true
then: {}
else:
properties:
foo:
type: string
```

Only supports simple const condition with one or more properties and not complex conditions like patterns. Also only a single if/tnen/else block per object is supported. It can be combined with [groups](uiSchema.md#uigroup).
Loading
Loading