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

array_boundary

Table of contents

Description:

This key defines the characters that start and end array literals when parsing snippet parameters.

The value is an object that contains start and end properties, each specifying a string token. For arrays, this will usually be { start: "[", end: "]" }.

Appears in:
└── Snippet Format
    └── array_boundary
Type:
Object
Properties:
endstring#

This key defines the end token for array boundaries when parsing snippet parameters.

The value is a string that specifies the token that marks the end of an array in snippet parameter parsing. This works together with array_boundary.start to define paired tokens that enclose arrays.

Defaults to:

Show examplesHide examples

In this example, we have configured array boundaries to use square brackets.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            array_boundary:
              start: '['
              end: ']'
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "array_boundary": {
                "start": "[",
                "end": "]"
              }
            }
          }
        }
      }
    }
  }
}
startstring#

This key defines the start token for array boundaries when parsing snippet parameters.

The value is a string that specifies the token that marks the start of an array in snippet parameter parsing. This works together with array_boundary.end to define paired tokens that enclose arrays.

Defaults to:

Show examplesHide examples

In this example, we have configured array boundaries to use square brackets.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            array_boundary:
              start: '['
              end: ']'
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "array_boundary": {
                "start": "[",
                "end": "]"
              }
            }
          }
        }
      }
    }
  }
}
Examples:

In this example, we have configured array boundaries to use square brackets.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            array_boundary:
              start: '['
              end: ']'
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "array_boundary": {
                "start": "[",
                "end": "]"
              }
            }
          }
        }
      }
    }
  }
}
Open in a new tab