diff options
author | Ed Tanous <ed@tanous.net> | 2024-03-07 01:41:27 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2024-04-04 01:51:36 +0300 |
commit | 3dfed536df173ea6d37ac93f428b9094b6a736d1 (patch) | |
tree | c006eca705e05b5fe33bd97a4021a28b8cf49fed /include/login_routes.hpp | |
parent | c1019828b612ffacea8408eec4a826a8ac601f13 (diff) | |
download | bmcweb-3dfed536df173ea6d37ac93f428b9094b6a736d1.tar.xz |
Clean up Ethernet to use readJson
Today, patching ethernet ip address arrays can use several
styles.
IpAddresses: [{}, {value: value}, null]
All 3 of those elements are legal. Today, we unpack values like that
with nlohmann::json, then iterate and unpack further. This leads to
problems where:
IpAddresses: [{}, {value: value}, 1.0]
would have the same behavior as the prior, given that we check for
"is_object()" to determine the null state. This is messy at best, and
not typesafe at worst.
Changing this code to use the new class NullOr<> allows the readJson
parser to fail the second example.
Change-Id: Id91f48bb64271dd568041a7c0b1ad285b59d5674
Signed-off-by: Ed Tanous <ed@tanous.net>
Diffstat (limited to 'include/login_routes.hpp')
0 files changed, 0 insertions, 0 deletions