From 869b5f07b5a01b7e3785b543479cc29551b436cb Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Sat, 6 Jan 2024 14:23:36 +0100 Subject: [PATCH] feat(doc): add CSV ref. to README --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 63eae75..e79018c 100644 --- a/README.md +++ b/README.md @@ -99,11 +99,11 @@ Type|Description --|-- `Type::NUMERIC`|Value must be a number or a numeric string `Type::STRING`|Value must be a string -`Type::BOOLEAN`|Value must be a boolean or ([**considered bool for GET rules**](#boolean-coercion-from-string-for-search-parameters)) -`Type::ARRAY`|Value must be a JSON array +`Type::BOOLEAN`|Value must be a boolean ([**considered bool for GET rules**](#boolean-coercion-from-string-for-search-parameters)) +`Type::ARRAY`|Value must be a JSON array or ([**CSV for GET rules**](#csv-for-search-parameters)) `Type::OBJECT`|Value must be a JSON object `Type::ENUM`|Value must be exactly one of pre-defined values ([**more information**](#typeenum)) -`Type::NULL`|Value must be null or ([**considered null for GET rules**](#null-coercion-from-string-for-search-parameters)) +`Type::NULL`|Value must be null ([**considered null for GET rules**](#null-coercion-from-string-for-search-parameters)) #### `Type::ENUM` @@ -136,6 +136,19 @@ Any other value will cause the `type()` rule to fail. > [!IMPORTANT] > This coercion is only applies for `Ruleset->GET()`. `Ruleset->POST()` will enforce real `true` and `type` values since it's JSON +#### CSV array for search parameters +A CSV string is expected when `Type::ARRAY` is set for a GET rule. + +*Example:* +``` +https://example.com?typeArray=key1,key2,key3 +``` + +Any other value will cause the `type()` rule to fail. + +> [!IMPORTANT] +> This coercion is only applies for `Ruleset->GET()`. `Ruleset->POST()` will enforce a JSON array + #### Null coercion from string for search parameters Search parameters are read as strings, a null value is therefor coerced from an empty string `""`.