--- title: ValidRenderSnippetArgumentTypes description: Ensures arguments passed to snippet match the expected types defined in LiquidDoc. source_url: html: https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-render-snippet-argument-types md: https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-render-snippet-argument-types.md --- ExpandOn this page * [Examples](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-render-snippet-argument-types#examples) * [Options](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-render-snippet-argument-types#options) * [Disabling this check](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-render-snippet-argument-types#disabling-this-check) # ValidRenderSnippetArgumentTypes All arguments provided when rendering a snippet must match the respective parameter's type defined in that snippet's LiquidDoc. If the argument is a variable this check will always pass. *** ## Examples The following examples contain code snippets that either fail or pass this check. All examples refer to the following snippet with optional parameters. ## snippets/example-snippet.liquid ```liquid {% doc %} @param {string} [some_str] @param {number} [some_num] @param {boolean} [some_bool] @param {object} [some_obj] @param [some_untyped] {% enddoc %} ``` ### ✗ Fail In the following example, the snippet is being rendered with an incorrect type: ## sections/section.liquid ```liquid {% render 'example-snippet', some_str: 1 %} ``` ### ✓ Pass In the following example, all arguments passed into the snippet match the expected type: ## sections/section.liquid ```liquid {% render 'example-snippet', some_str: 'text', some_num: 1, some_bool: false, some_obj: shop, some_untyped: product %} ``` NOTE: `shop` and `product` are global liquid variables ### ✓ Pass In the following example, an object is passed as a boolean argument since all Liquid objects can be truthy/falsey: ## sections/section.liquid ```liquid {% render 'example-snippet', some_bool: product %} ``` ### ✓ Pass In the following example, a variable is passed as an argument, which will always pass this check: ## sections/section.liquid ```liquid {% assign some_var = 'text' %} {% render 'example-snippet', some_str: some_var, some_num: some_var, some_bool: some_var, some_obj: some_var, some_untyped: some_var %} ``` *** ## Options The following example contains the default configuration for this check: ```yaml ValidRenderSnippetArgumentTypes: enabled: true severity: warning ``` | Parameter | Description | | - | - | | `enabled` | Whether this check is enabled. | | `severity` | The [severity](https://shopify.dev/docs/storefronts/themes/tools/theme-check/configuration#check-severity) of the check. | *** ## Disabling this check Disabling this check isn't recommended. *** * [Examples](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-render-snippet-argument-types#examples) * [Options](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-render-snippet-argument-types#options) * [Disabling this check](https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-render-snippet-argument-types#disabling-this-check)