Parameters

Parameter schema

The Parameter schema is used to define input and/or output data to be used by OpenWhisk entities for the purposes of validation.

Fields

Requirements

The ‘schema’ key's value MUST be compatible with the value provided on both the ‘type’ and ‘value’ keys; otherwise, it is considered an error.

Notes

The ‘type’ key acknowledges some popular schema (e.g., JSON) to use when validating the value of the parameter. In the future additional (schema) types may be added for convenience.

Grammar

Single-line

Where is inferred to be a YAML type as shown in the YAML Types section above (e.g., string, integer, float, boolean, etc.).

If you wish the parser to validate against a different schema, then the multi-line grammar MUST be used where the value would be supplied on the keyname ‘value’ and the type (e.g., ‘json’) and/or schema (e.g., OpenAPI) can be supplied.

Multi-line

Status values

Dollar Notation ($) schema for values

In a Manifest or Deployment file, a parameter value may be set from the local execution environment by using the dollar ($) notation to denote names of local environment variables which supply the value to be inserted at execution time.

Syntax

<parameter>: $<local environment variable name>

Example

...
  inputs:
    userName: $DEFAULT_USERNAME

Requirements

  • Processors or tooling that encounter ($) Dollar notation and are unable to locate the value in the execution environment SHOULD resolve the value to be the default value for the type (e.g., an empty string ("") for type ‘string’).

Notes

  • Processors or tooling that encounter ($) Dollar notation for values should attempt to locate the corresponding named variables set into the local execution environment (e.g., where the tool was invoked) and assign its value to the named input parameter for the OpenWhisk entity.
  • This specification does not currently consider using this notation for other than simple data types (i.e., we support this mechanism for values such as strings, integers, floats, etc.) at this time.