]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/ceph_json: dump bool using f->dump_bool() 45835/head
authorKefu Chai <tchaikov@gmail.com>
Sun, 10 Apr 2022 01:23:59 +0000 (09:23 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sat, 21 May 2022 08:32:14 +0000 (16:32 +0800)
commit6677658992af9735e70c521f9f46871d87a34d85
treec8d15b557382958707ec19f0017a1a4c9f78304e
parent6db901185cf6e3cd9a4698e6ed65b671ac497b83
common/ceph_json: dump bool using f->dump_bool()

as per https://www.json.org/json-en.html, JSON encodes bool as
"true" or "false", without the quotes. before this change, the quotes
are always added when encoding boolean values.

but this change is not backward compatible.

encode_json()'s bool overload is used by rgw. it uses JSONObj
defined in common/ceph_json.h to decode JSON-encoded structs.
and it does not differentiate bool from str when decoding a boolean
value despite that it could have check the "quoted" member variable
of JSONObj for validating the type of value. so we should be fine.

Fixes: https://tracker.ceph.com/issues/55189
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
PendingReleaseNotes
doc/radosgw/pubsub-module.rst
src/common/ceph_json.cc
src/pybind/mgr/dashboard/services/rgw_client.py