Introduce slapconfiguration:jsonschema recipe
-
Enable
<= slap-connectioninslapconfigurationusage
This is for convenience, to allow[slap-configuration] <= slap-connection recipe = slapos.cookbook:slapconfiguration -
Add
slapconfiguration:jsonschemarecipe. This validates the parameter dict against the JSON schema, and fills in defaults from the schema first if the property is not set by the user. This allows for a unique source of truth in default parameters :) It also uses the serialisation in the schema to determine how the parameters should be parsed (xmlorjson-in-xml). It requires downloading the JSON schemas in the SR.- This works for both regular instance parameters and for shared instance parameters.
- Errors in the regular instance parameters lead to a raised exception, but errors in shared instance parameters just result in this shared instance being collected in
invalid-shared-instance-list, while valid shared instances are collected invalid-shared-instance-list.
-
Add toggle parameters to
slapconfiguration:jsonschemato allow selecting whether validating parameters and setting defaults apply to main or shared parameters or both or neither:
| apply to | validate-parameters |
set-default |
|---|---|---|
| neither main nor shared | none |
none |
| shared parameters | main |
main |
| main parameters | shared |
shared |
| main and shared | all |
all |