The SOMOD Parameters define the configurations for the module. ui/config.yaml
and serverless/template.yaml
refer to the parameters available in the parameters.yaml
.
ui/config.yaml
and serverless/template.yaml
can refer to the parameters from the current and all dependency modules.
When more than one dependency module has the same parameter defined, the conflict is resolved using the namespaces.
SOMOD build command validates parameters.yaml
and generates build/parameters.json
. SOMOD prepare command combines parameters from all dependency modules and updates the missing values in the root parameters.json. The prepare command also generates the NextJs and AWS SAM configuration files from parameters.json in the root.
project-root | +-- node_modules --+ | +-- module-a | | +-- build/ | FROM DEPENDENCIES | +--parameters.json | | --+ | +-- build/ --+ | +-- parameters.json | BUILD OUTPUT | --+ | +-- parameters.yaml --- SOURCE | +-- parameters.json --- PREPARED
parameters: mycomponent.param1: # parameter name type: string # parameter schema follows JSON-Schema7 specification default: waw maxLength: 20 mycomponent.param2: type: email default: me@example.com
The parameters.yaml
contains one section, parameters
parameters
parameters is a map of the parameter name to JSON schema.
Parameter name
The parameter name has the following constraints
Parameter Schema
Must use the JSON-Schema version 7 specification.
In the Next Chapter, let us understand the namespaces in SOMOD.
Write an email to opensource@sodaru.com