☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

type

Table of contents

Description:

This key defines the data type for snippet parameter parsing.

The value can be array, object, string, boolean, or number. This specifies the expected data type when parsing snippet parameters.

Appears in:
└── Snippet Model
    └── type
Type:
string
Allowed values:
array
object
string
boolean
number
Examples:

In this example, we have configured a snippet model to expect a string type.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          model:
            type: string
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "model": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
Open in a new tab