From 34f2f39abe5e7b7f6ad96b889300553d0160532c Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 7 Jul 2025 10:06:08 -0700 Subject: [PATCH] json filter: update docs (#84989) Signed-off-by: Abhijeet Kasurde Co-authored-by: Brian Coca Co-authored-by: Matt Clay --- lib/ansible/plugins/filter/to_json.yml | 12 ++++++++---- lib/ansible/plugins/filter/to_nice_json.yml | 5 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/ansible/plugins/filter/to_json.yml b/lib/ansible/plugins/filter/to_json.yml index 003e5a19eb9..55b7607cab6 100644 --- a/lib/ansible/plugins/filter/to_json.yml +++ b/lib/ansible/plugins/filter/to_json.yml @@ -23,8 +23,9 @@ DOCUMENTATION: default: True version_added: '2.9' allow_nan: - description: When V(False), strict adherence to float value limits of the JSON specifications, so C(nan), C(inf) and C(-inf) values will produce errors. - When V(True), JavaScript equivalents will be used (C(NaN), C(Infinity), C(-Infinity)). + description: + - When V(False), out-of-range float values C(nan), C(inf) and C(-inf) will result in an error. + - When V(True), out-of-range float values will be represented using their JavaScript equivalents, C(NaN), C(Infinity) and C(-Infinity). default: True type: bool check_circular: @@ -42,8 +43,11 @@ DOCUMENTATION: separators: description: The C(item) and C(key) separator to be used in the serialized output, default may change depending on O(indent) and Python version. - default: "(', ', ': ')" - type: tuple + default: + - ', ' + - ': ' + type: list + elements: str skipkeys: description: If V(True), keys that are not basic Python types will be skipped. default: False diff --git a/lib/ansible/plugins/filter/to_nice_json.yml b/lib/ansible/plugins/filter/to_nice_json.yml index abaeee0c071..2c87f3e6d67 100644 --- a/lib/ansible/plugins/filter/to_nice_json.yml +++ b/lib/ansible/plugins/filter/to_nice_json.yml @@ -23,8 +23,9 @@ DOCUMENTATION: default: True version_added: '2.9' allow_nan: - description: When V(False), strict adherence to float value limits of the JSON specification, so C(nan), C(inf) and C(-inf) values will produce errors. - When V(True), JavaScript equivalents will be used (C(NaN), C(Infinity), C(-Infinity)). + description: + - When V(False), out-of-range float values C(nan), C(inf) and C(-inf) will result in an error. + - When V(True), out-of-range float values will be represented using their JavaScript equivalents, C(NaN), C(Infinity) and C(-Infinity). default: True type: bool check_circular: