xref: /openbmc/bmcweb/features/redfish/include/error_message_utils.hpp (revision 6c038f260633414c52ac34ac44d0d3ab23c3d9a5)
1*6c038f26SEd Tanous #include <nlohmann/json.hpp>
2*6c038f26SEd Tanous 
3*6c038f26SEd Tanous #include <string_view>
4*6c038f26SEd Tanous 
5*6c038f26SEd Tanous namespace redfish
6*6c038f26SEd Tanous {
7*6c038f26SEd Tanous 
8*6c038f26SEd Tanous namespace messages
9*6c038f26SEd Tanous {
10*6c038f26SEd Tanous 
11*6c038f26SEd Tanous constexpr const char* messageVersionPrefix = "Base.1.19.0.";
12*6c038f26SEd Tanous constexpr const char* messageAnnotation = "@Message.ExtendedInfo";
13*6c038f26SEd Tanous 
14*6c038f26SEd Tanous void moveErrorsToErrorJson(nlohmann::json& target, nlohmann::json& source);
15*6c038f26SEd Tanous void addMessageToJsonRoot(nlohmann::json& target,
16*6c038f26SEd Tanous                           const nlohmann::json& message);
17*6c038f26SEd Tanous 
18*6c038f26SEd Tanous void addMessageToJson(nlohmann::json& target, const nlohmann::json& message,
19*6c038f26SEd Tanous                       std::string_view fieldPath);
20*6c038f26SEd Tanous 
21*6c038f26SEd Tanous void addMessageToErrorJson(nlohmann::json& target,
22*6c038f26SEd Tanous                            const nlohmann::json& message);
23*6c038f26SEd Tanous } // namespace messages
24*6c038f26SEd Tanous } // namespace redfish
25