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

allowed_string_cases

Table of contents

Description:

This key defines which string case types are allowed when parsing snippet parameters.

The value is an object that can contain any, leading_upper, leading_lower, lower, or upper properties. Each property is a boolean that enables or disables that case type.

Appears in:
└── Snippet Format
    └── allowed_string_cases
Type:
Object
Properties:
anyboolean#

This key toggles whether CloudCannon will allow any string case type when parsing snippet parameters.

Setting this key to true will allow any case type (uppercase, lowercase, mixed case) in snippet parameter parsing.

By default, this key is false (i.e., case restrictions apply based on other allowed_string_cases settings).

Show examplesHide examples

In this example, we have configured snippet format to allow any string case type.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            allowed_string_cases:
              any: true
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "allowed_string_cases": {
                "any": true
              }
            }
          }
        }
      }
    }
  }
}

This key toggles whether CloudCannon will allow strings starting with a lowercase letter when parsing snippet parameters.

Setting this key to true will allow strings that begin with a lowercase letter in snippet parameter parsing.

By default, this key is false (i.e., strings starting with lowercase are not allowed unless any is enabled).

Show examplesHide examples

In this example, we have configured snippet format to allow strings starting with a lowercase letter.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            allowed_string_cases:
              leading_lower: true
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "allowed_string_cases": {
                "leading_lower": true
              }
            }
          }
        }
      }
    }
  }
}

This key toggles whether CloudCannon will allow strings starting with an uppercase letter when parsing snippet parameters.

Setting this key to true will allow strings that begin with an uppercase letter in snippet parameter parsing.

By default, this key is false (i.e., strings starting with uppercase are not allowed unless any is enabled).

Show examplesHide examples

In this example, we have configured snippet format to allow strings starting with an uppercase letter.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            allowed_string_cases:
              leading_upper: true
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "allowed_string_cases": {
                "leading_upper": true
              }
            }
          }
        }
      }
    }
  }
}
lowerboolean#

This key toggles whether CloudCannon will allow only lowercase strings when parsing snippet parameters.

Setting this key to true will require all characters to be lowercase in snippet parameter parsing.

By default, this key is false (i.e., lowercase-only strings are not required unless any is enabled).

Show examplesHide examples

In this example, we have configured snippet format to allow only lowercase strings.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            allowed_string_cases:
              lower: true
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "allowed_string_cases": {
                "lower": true
              }
            }
          }
        }
      }
    }
  }
}
upperboolean#

This key toggles whether CloudCannon will allow only uppercase strings when parsing snippet parameters.

Setting this key to true will require all characters to be uppercase in snippet parameter parsing.

By default, this key is false (i.e., uppercase-only strings are not required unless any is enabled).

Show examplesHide examples

In this example, we have configured snippet format to allow only uppercase strings.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            allowed_string_cases:
              upper: true
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "allowed_string_cases": {
                "upper": true
              }
            }
          }
        }
      }
    }
  }
}
Examples:

In this example, we have configured snippet format to allow only lowercase strings.

Copied to clipboard
_snippets:
  example:
    snippet: <<example [[param]]>>
    params:
      param:
        parser: argument
        options:
          format:
            allowed_string_cases:
              lower: true
{
  "_snippets": {
    "example": {
      "snippet": "<<example [[param]]>>",
      "params": {
        "param": {
          "parser": "argument",
          "options": {
            "format": {
              "allowed_string_cases": {
                "lower": true
              }
            }
          }
        }
      }
    }
  }
}
Open in a new tab