fix in object.md: clarified the conditions section
also fixed a dead link at the end of object.md
parent
2d93b0e984
commit
bce2cc3181
1 changed files with 13 additions and 2 deletions
15
object.md
15
object.md
|
|
@ -151,7 +151,7 @@ array of templates and their properties under `input` that this property matches
|
||||||
|
|
||||||
### `conditions`
|
### `conditions`
|
||||||
|
|
||||||
must be referring to another property (can be itself). array of values that property must have for this property to be valid in the object instance. **this is mostly there for `input.variant` shenanigans and is NOT to be used for data validation!**
|
must be referring to another property (can be itself). array of values that property must have for this property to be valid in the object instance. **this is mostly there for `input.variant` shenanigans and is NOT to be used for advanced data validation!**
|
||||||
|
|
||||||
an example would look like this:
|
an example would look like this:
|
||||||
|
|
||||||
|
|
@ -162,8 +162,19 @@ conditions = [
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
if a property is referenced multiple times, all of the provided options will be valid (example from `meta/connection`):
|
||||||
|
|
||||||
|
```toml
|
||||||
|
conditions = [
|
||||||
|
["input.variant", "function"]
|
||||||
|
["input.variant", "transform"]
|
||||||
|
["input.variant", "subobject"]
|
||||||
|
["input.variant", "custom"]
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
### `duplicates`
|
### `duplicates`
|
||||||
|
|
||||||
boolean indicating if this property can be duplicated.
|
boolean indicating if this property can be duplicated.
|
||||||
|
|
||||||
if `true`, it will use an array when represented in json. it can only contain properties specified in `transforms`. when used as transform destinations, duplicable properties add the source property's value to the first (0th) position, and the remaining positions can be filled later by [functions](functions.md).
|
if `true`, it will use an array when represented in json. it can only contain properties specified in `transforms`. when used as transform destinations, duplicable properties add the source property's value to the first (0th) position, and the remaining positions can be filled later by [calculators](modularity.md#calculator).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue