Mercurial > hg > piper-vamp-js
comparison VamPipePluginLibrary.cpp @ 71:4f16ceb503c4
Some JSON fixes and a quick test program
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Tue, 23 Aug 2016 12:04:49 +0100 |
parents | caf75dce15e5 |
children | 6a792d8838c9 |
comparison
equal
deleted
inserted
replaced
70:caf75dce15e5 | 71:4f16ceb503c4 |
---|---|
56 throw VampJson::Failure("object expected at top level"); | 56 throw VampJson::Failure("object expected at top level"); |
57 } | 57 } |
58 if (!j["type"].is_string()) { | 58 if (!j["type"].is_string()) { |
59 throw VampJson::Failure("string expected for type field"); | 59 throw VampJson::Failure("string expected for type field"); |
60 } | 60 } |
61 if (!j["content"].is_object()) { | 61 if (!j["content"].is_null() && !j["content"].is_object()) { |
62 throw VampJson::Failure("object expected for content field"); | 62 throw VampJson::Failure("object expected for content field"); |
63 } | 63 } |
64 return j; | 64 return j; |
65 } | 65 } |
66 | 66 |