From 750f7120ea4e208243b0f14486774ae03362d913 Mon Sep 17 00:00:00 2001 From: jcamiel Date: Fri, 22 Mar 2024 09:48:24 +0100 Subject: [PATCH] Update documentation for isIsoDate. --- docs/asserting-response.md | 5 +++-- docs/grammar.md | 16 +++++++++------- docs/samples.md | 1 + docs/spec/grammar/hurl.grammar | 3 +++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/asserting-response.md b/docs/asserting-response.md index e50203ddd..81a138eb6 100644 --- a/docs/asserting-response.md +++ b/docs/asserting-response.md @@ -182,7 +182,7 @@ Predicates consist of a predicate function and a predicate value. Predicate func | __`exists`__ | Query returns a value | `jsonpath "$.book" exists` | | __`isBoolean`__ | Query returns a boolean | `jsonpath "$.succeeded" isBoolean` | | __`isCollection`__ | Query returns a collection | `jsonpath "$.books" isCollection` | -| __`isDate`__ | Query returns a date | `jsonpath "$.publication_date" isDate` | +| __`isIsoDate`__ | Query string returns a [RFC 3339] date (`YYYY-MM-DDTHH:mm:ss.sssZ`) | `jsonpath "$.publication_date" isIsoDate` | | __`isEmpty`__ | Query returns an empty collection | `jsonpath "$.movies" isEmpty` | | __`isFloat`__ | Query returns a float | `jsonpath "$.height" isFloat` | | __`isInteger`__ | Query returns an integer | `jsonpath "$.count" isInteger` | @@ -827,4 +827,5 @@ of all file nodes. [filters]: /docs/filters.md [count]: /docs/filters.md#count [`decode` filter]: /docs/filters.md#decode -[headers implicit asserts]: #headers \ No newline at end of file +[headers implicit asserts]: #headers +[RFC 3339]: https://www.rfc-editor.org/rfc/rfc3339 diff --git a/docs/grammar.md b/docs/grammar.md index 475185d51..ffc5ca84c 100644 --- a/docs/grammar.md +++ b/docs/grammar.md @@ -165,7 +165,8 @@ Short description: |boolean-predicate
|string-predicate
|collection-predicate
-|date-predicate +|date-predicate
+|iso-date-predicate
equal-predicate(used by predicate-func)
(equals|==) sp predicate-value
not-equal-predicate(used by predicate-func)
(notEquals|!=) sp predicate-value
greater-predicate(used by predicate-func)
(greaterThan|>) sp (number|quoted-string)
@@ -185,6 +186,7 @@ Short description:
string-predicate(used by predicate-func)
isString
collection-predicate(used by predicate-func)
isCollection
date-predicate(used by predicate-func)
isDate
+
iso-date-predicate(used by predicate-func)
isIsoDate
 boolean
|multiline-string
|null
@@ -234,13 +236,13 @@ Short description:
multiline-string-escaped-char(used by multiline-string-content)
\ (\|b|f|n|r|t|`|u unicode-char)
filename-content(used by filename)
-
~[#; \n\\]+
-
filename-escaped-char(used by filename-contentfilename-password-content)
\ (;|#|[ ])
+
filename-text(used by filename-content)
~[#;{} \n\\]+
+
filename-escaped-char(used by filename-content)
\ (\|b|f|n|r|t|#|;| |{|}|u unicode-char)
- -
password-text(used by filename-password-content)
~[#; \n\\]+
-
password-escaped-char(used by filename-password-content)
\ (;|#|[ ])
- + +
filename-password-text(used by filename-password-content)
~[#;{} \n\\]+
+
filename-password-escaped-char(used by filename-password-content)
\ (\|b|f|n|r|t|#|;| |{|}|u unicode-char)
+

JSON

json-value(used by bytesjson-key-valuejson-array)
 template
|json-object
|json-array
diff --git a/docs/samples.md b/docs/samples.md index a73ac485d..834763744 100644 --- a/docs/samples.md +++ b/docs/samples.md @@ -307,6 +307,7 @@ jsonpath "$.links" count == 12 jsonpath "$.state" != null jsonpath "$.order" matches "^order-\\d{8}$" jsonpath "$.order" matches /^order-\d{8}$/ # Alternative syntax with regex literal +jsonpath "$.created" isIsoDate ``` [Doc](/docs/asserting-response.md#jsonpath-assert) diff --git a/docs/spec/grammar/hurl.grammar b/docs/spec/grammar/hurl.grammar index b151bb473..c9f57f23e 100644 --- a/docs/spec/grammar/hurl.grammar +++ b/docs/spec/grammar/hurl.grammar @@ -296,6 +296,7 @@ predicate-func: | string-predicate | collection-predicate | date-predicate + | iso-date-predicate equal-predicate: ("equals" | "==") sp predicate-value @@ -335,6 +336,8 @@ collection-predicate: "isCollection" date-predicate: "isDate" +iso-date-predicate: "isIsoDate" + predicate-value: boolean | multiline-string