MCPcopy Create free account
hub / github.com/pboettch/json-schema-validator / content

Function content

test/binary-validation.cpp:94–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92};
93
94static void content(const std::string &contentEncoding, const std::string &contentMediaType, const json &instance)
95{
96 std::cerr << "mediaType: '" << contentMediaType << "', encoding: '" << contentEncoding << "'\n";
97
98 if (contentEncoding == "binary") {
99 if (instance.type() != json::value_t::binary) {
100 throw std::invalid_argument{"expected binary data"};
101 }
102 } else {
103 if (instance.type() == json::value_t::binary) {
104 throw std::invalid_argument{"expected string, but get binary"};
105 }
106 }
107}
108
109int main()
110{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected