Parameters


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

Anatomy of parameters.yaml

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

      • must contain only the alphabet, numbers, and dots
      • can have a maximum of 128 characters.
      • must start with the alphabet
      • and must have at least one dot
    • Parameter Schema
      Must use the JSON-Schema version 7 specification.

In the Next Chapter, let us understand the namespaces in SOMOD.

Does this page need improvements?
Edit This Page in GitHub
Did this page help you?
Provide feedback in the GitHub Discussion Page
Need More help?

Write an email to opensource@sodaru.com

This documentation is built using
Developed and Maintained By
Sodaru Technologies
https://sodaru.com
© 2023