Force json commands to be objects

* Null json values can be objects or arrays.
* json arrays are now interpreted as batch commands.
* json objects are single commands.
* null jsons are ambiguous as to whether they are single or batch
  commands and should be avoided.
This commit is contained in:
Howard Hinnant
2018-01-04 15:55:03 -05:00
committed by Nikolaos D. Bougalis
parent e3499b5df8
commit 7ff6d34a49
2 changed files with 28 additions and 13 deletions

View File

@@ -385,12 +385,27 @@ public:
}
}
void
test_validation_create()
{
using namespace test::jtx;
Env env{*this};
auto result = env.rpc("validation_create");
BEAST_EXPECT(result.isMember(jss::result) &&
result[jss::result][jss::status] == "success");
result = env.rpc("validation_create",
"BAWL MAN JADE MOON DOVE GEM SON NOW HAD ADEN GLOW TIRE");
BEAST_EXPECT(result.isMember(jss::result) &&
result[jss::result][jss::status] == "success");
}
void
run()
{
testPrivileges();
testStaticUNL();
testDynamicUNL();
test_validation_create();
}
};