1 // Copyright 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CAST_PROTOCOL_CASTV2_VALIDATION_H_ 6 #define CAST_PROTOCOL_CASTV2_VALIDATION_H_ 7 8 #include <vector> 9 10 #include "json/value.h" 11 #include "platform/base/error.h" 12 13 namespace openscreen { 14 namespace cast { 15 16 // Used to validate a JSON message against a JSON schema. 17 std::vector<Error> Validate(const Json::Value& document, 18 const Json::Value& schema_root); 19 20 // Used to validate streaming messages, such as OFFER or ANSWER. 21 std::vector<Error> ValidateStreamingMessage(const Json::Value& message); 22 23 // Used to validate receiver messages, such as LAUNCH or STOP. 24 std::vector<Error> ValidateReceiverMessage(const Json::Value& message); 25 26 } // namespace cast 27 } // namespace openscreen 28 29 #endif // CAST_PROTOCOL_CASTV2_VALIDATION_H_ 30