Generate error messages for Redfish

error_messages.hpp and error_messages.cpp were at one time generated.
That script has been lost to the sands of time, and since then there's
been lots of places where we've been inconsistent, or updated our base
registry without updating the generated code.  This causes wording,
syntax, and other errors.

This commit updates the script to simply generate this header with the
intent of generating it from here on out and avoid issues.  As written,
goes to great lengths to generate exactly the same code, and make only
changes to the doxygen comments, and add the missing types.  This is
done to allow for easy diffing that nothing important has changed.

Testing on last patch in series.

Change-Id: Ic1da1c02519098bdb53656d94a458b78c67d25bb
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/redfish-core/include/error_messages.hpp b/redfish-core/include/error_messages.hpp
index 4870b30..7816a59 100644
--- a/redfish-core/include/error_messages.hpp
+++ b/redfish-core/include/error_messages.hpp
@@ -1,19 +1,14 @@
-/*
-Copyright (c) 2018 Intel Corporation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
 #pragma once
+/****************************************************************
+ *                 READ THIS WARNING FIRST
+ * This is an auto-generated header which contains definitions
+ * for Redfish DMTF defined messages.
+ * DO NOT modify this registry outside of running the
+ * parse_registries.py script.  The definitions contained within
+ * this file are owned by DMTF.  Any modifications to these files
+ * should be first pushed to the relevant registry in the DMTF
+ * github organization.
+ ***************************************************************/
 
 #include "http_response.hpp"
 
@@ -78,7 +73,7 @@
 /**
  * @brief Formats ActionParameterValueFormatError message into JSON
  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
- * is of a different format than the parameter can accept."
+ * is not a format that the parameter can accept."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -101,7 +96,7 @@
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  * @param[in] arg3 Parameter of message that will replace %3 in its body.
  *
- * @returns Message ActionParameterValueFormatError formatted to JSON */
+ * @returns Message ActionParameterValueNotInList formatted to JSON */
 nlohmann::json actionParameterValueNotInList(
     std::string_view arg1, std::string_view arg2, std::string_view arg3);
 
@@ -215,8 +210,8 @@
 
 /**
  * @brief Formats AccountForSessionNoLongerExists message into JSON
- * Message body: "The account for the current session has been removed, thus the
- * current session has been removed as well."
+ * Message body: "The account for the current session was removed, and so the
+ * current session was removed as well."
  *
  *
  * @returns Message AccountForSessionNoLongerExists formatted to JSON */
@@ -239,8 +234,8 @@
 
 /**
  * @brief Formats PropertyValueFormatError message into JSON
- * Message body: "The value <arg1> for the property <arg2> is of a different
- * format than the property can accept."
+ * Message body: "The value <arg1> for the property <arg2> is not a format that
+ * the property can accept."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -266,15 +261,16 @@
 
 void propertyValueNotInList(crow::Response& res, const nlohmann::json& arg1,
                             std::string_view arg2);
+
 /**
  * @brief Formats PropertyValueOutOfRange message into JSON
- * Message body: "The value '%1' for the property %2 is not in the supported
- * range of acceptable values."
+ * Message body: "The value <arg1> for the property <arg2> is not in the
+ * supported range of acceptable values."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
- * @returns Message PropertyValueExternalConflict formatted to JSON */
+ * @returns Message PropertyValueOutOfRange formatted to JSON */
 nlohmann::json propertyValueOutOfRange(const nlohmann::json& arg1,
                                        std::string_view arg2);
 
@@ -298,7 +294,7 @@
 /**
  * @brief Formats ServiceDisabled message into JSON
  * Message body: "The operation failed because the service at <arg1> is disabled
- * and " cannot accept requests."
+ * and cannot accept requests."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
@@ -368,7 +364,7 @@
 
 /**
  * @brief Formats SubscriptionTerminated message into JSON
- * Message body: "The event subscription has been terminated."
+ * Message body: "The event subscription was terminated."
  *
  *
  * @returns Message SubscriptionTerminated formatted to JSON */
@@ -379,7 +375,7 @@
 /**
  * @brief Formats ResourceTypeIncompatible message into JSON
  * Message body: "The @odata.type of the request body <arg1> is incompatible
- * with the @odata.type of the resource which is <arg2>."
+ * with the @odata.type of the resource, which is <arg2>."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -393,8 +389,9 @@
 
 /**
  * @brief Formats ResetRequired message into JSON
- * Message body: "In order to complete the operation, a component reset is
- * required with the Reset action URI '<arg1>' and ResetType '<arg2>'."
+ * Message body: "In order to apply changes, recover from errors, or complete
+ * the operation, a component reset is required with the Reset action URI <arg1>
+ * and ResetType <arg2>."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -408,7 +405,7 @@
 
 /**
  * @brief Formats ChassisPowerStateOnRequired message into JSON
- * Message body: "The Chassis with Id '<arg1>' requires to be powered on to
+ * Message body: "The chassis with Id <arg1> is required to be powered on to
  * perform this request."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
@@ -420,7 +417,7 @@
 
 /**
  * @brief Formats ChassisPowerStateOffRequired message into JSON
- * Message body: "The Chassis with Id '<arg1>' requires to be powered off to
+ * Message body: "The chassis with Id <arg1> is required to be powered off to
  * perform this request."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
@@ -432,8 +429,8 @@
 
 /**
  * @brief Formats PropertyValueConflict message into JSON
- * Message body: "The property '<arg1>' could not be written because its value
- * would conflict with the value of the '<arg2>' property."
+ * Message body: "The property <arg1> could not be written because its value
+ * would conflict with the value of the <arg2> property."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -447,15 +444,15 @@
 
 /**
  * @brief Formats PropertyValueResourceConflict message into JSON
- * Message body: "The property '%1' with the requested value of '%2' could
- * not be written because the value conflicts with the state or configuration
- * of the resource at '%3'."
+ * Message body: "The property <arg1> with the requested value of <arg2> could
+ * not be written because the value conflicts with the state or configuration of
+ * the resource at <arg3>."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  * @param[in] arg3 Parameter of message that will replace %3 in its body.
  *
- * @returns Message PropertyValueResourceConflict to JSON */
+ * @returns Message PropertyValueResourceConflict formatted to JSON */
 nlohmann::json propertyValueResourceConflict(
     std::string_view arg1, const nlohmann::json& arg2,
     const boost::urls::url_view_base& arg3);
@@ -466,8 +463,8 @@
 
 /**
  * @brief Formats PropertyValueExternalConflict message into JSON
- * Message body: "The property '%1' with the requested value of '%2' could not
- * be written because the value is not available due to a configuration
+ * Message body: "The property <arg1> with the requested value of <arg2> could
+ * not be written because the value is not available due to a configuration
  * conflict."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
@@ -482,8 +479,8 @@
 
 /**
  * @brief Formats PropertyValueIncorrect message into JSON
- * Message body: "The property '<arg1>' with the requested value of '<arg2>'
- * could not be written because the value does not meet the constraints of the
+ * Message body: "The property <arg1> with the requested value of <arg2> could
+ * not be written because the value does not meet the constraints of the
  * implementation."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
@@ -499,7 +496,7 @@
 /**
  * @brief Formats ResourceCreationConflict message into JSON
  * Message body: "The resource could not be created.  The service has a resource
- * at URI '<arg1>' that conflicts with the creation request."
+ * at URI <arg1> that conflicts with the creation request."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
@@ -565,8 +562,8 @@
 
 /**
  * @brief Formats PropertyValueTypeError message into JSON
- * Message body: "The value <arg1> for the property <arg2> is of a different
- * type than the property can accept."
+ * Message body: "The value <arg1> for the property <arg2> is not a type that
+ * the property can accept."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -584,7 +581,7 @@
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
- * @returns Message PropertyValueTypeError formatted to JSON */
+ * @returns Message PropertyValueError formatted to JSON */
 nlohmann::json propertyValueError(std::string_view arg1);
 
 void propertyValueError(crow::Response& res, std::string_view arg1);
@@ -605,7 +602,7 @@
 
 /**
  * @brief Formats CouldNotEstablishConnection message into JSON
- * Message body: "The service failed to establish a Connection with the URI
+ * Message body: "The service failed to establish a connection with the URI
  * <arg1>."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
@@ -619,7 +616,7 @@
 
 /**
  * @brief Formats PropertyNotWritable message into JSON
- * Message body: "The property <arg1> is a read only property and cannot be
+ * Message body: "The property <arg1> is a read-only property and cannot be
  * assigned a value."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
@@ -631,8 +628,8 @@
 
 /**
  * @brief Formats QueryParameterValueTypeError message into JSON
- * Message body: "The value <arg1> for the query parameter <arg2> is of a
- * different type than the parameter can accept."
+ * Message body: "The value <arg1> for the query parameter <arg2> is not a type
+ * that the parameter can accept."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -687,7 +684,7 @@
 
 /**
  * @brief Formats SourceDoesNotSupportProtocol message into JSON
- * Message body: "The other end of the Connection at <arg1> does not support the
+ * Message body: "The other end of the connection at <arg1> does not support the
  * specified protocol <arg2>."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
@@ -703,8 +700,10 @@
 
 /**
  * @brief Formats StrictAccountTypes message into JSON
- * Message body: Indicates the request failed because a set of `AccountTypes` or
- * `OEMAccountTypes` was not accepted while `StrictAccountTypes` is set to `true
+ * Message body: "The request could not be fulfilled with the account types
+ * included in property <arg1> because the property StrictAccountTypes is set to
+ * true."
+ *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message StrictAccountTypes formatted to JSON */
@@ -724,7 +723,7 @@
 
 /**
  * @brief Formats AccessDenied message into JSON
- * Message body: "While attempting to establish a Connection to <arg1>, the
+ * Message body: "While attempting to establish a connection to <arg1>, the
  * service denied access."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
@@ -757,8 +756,9 @@
 
 /**
  * @brief Formats GeneralError message into JSON
- * Message body: "A general error has occurred. See ExtendedInfo for more
- * information."
+ * Message body: "A general error has occurred.  See Resolution for information
+ * on how to resolve the error, or @Message.ExtendedInfo if Resolution is not
+ * provided."
  *
  *
  * @returns Message GeneralError formatted to JSON */
@@ -768,7 +768,7 @@
 
 /**
  * @brief Formats Success message into JSON
- * Message body: "Successfully Completed Request"
+ * Message body: "The request completed successfully."
  *
  *
  * @returns Message Success formatted to JSON */
@@ -778,7 +778,7 @@
 
 /**
  * @brief Formats Created message into JSON
- * Message body: "The resource has been created successfully"
+ * Message body: "The resource was created successfully."
  *
  *
  * @returns Message Created formatted to JSON */
@@ -788,8 +788,8 @@
 
 /**
  * @brief Formats NoOperation message into JSON
- * Message body: "The request body submitted contain no data to act upon and
- * no changes to the resource took place."
+ * Message body: "The request body submitted contain no data to act upon and no
+ * changes to the resource took place."
  *
  *
  * @returns Message NoOperation formatted to JSON */
@@ -845,7 +845,7 @@
 /**
  * @brief Formats ActionParameterValueTypeError message into JSON
  * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
- * is of a different type than the parameter can accept."
+ * is not a type that the parameter can accept."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -861,8 +861,8 @@
 
 /**
  * @brief Formats ActionParameterValueError message into JSON
- * Message body: "Indicates that a parameter was given an invalid value."
- *  The value for the parameter %1 in the action %2 is invalid.
+ * Message body: "The value for the parameter <arg1> in the action <arg2> is
+ * invalid."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
@@ -951,11 +951,11 @@
 
 /**
  * @brief Formats EventBufferExceeded message into JSON
- * Message body: "Indicates undelivered events may have been lost due to a lack
- * of buffer space in the service."
+ * Message body: "Undelivered events may have been lost due to exceeding the
+ * event buffer."
  *
  *
- * @returns Message QueryCombinationInvalid formatted to JSON */
+ * @returns Message EventBufferExceeded formatted to JSON */
 nlohmann::json eventBufferExceeded();
 
 void eventBufferExceeded(crow::Response& res);
@@ -999,14 +999,13 @@
 
 /**
  * @brief Formats QueryParameterValueFormatError message into JSON
- * Message body: "The value <arg1> for the parameter <arg2> is of a different
- * format than the parameter can accept."
+ * Message body: "The value <arg1> for the parameter <arg2> is not a format that
+ * the parameter can accept."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
  * @returns Message QueryParameterValueFormatError formatted to JSON */
-
 nlohmann::json queryParameterValueFormatError(const nlohmann::json& arg1,
                                               std::string_view arg2);
 
@@ -1065,14 +1064,13 @@
 
 /**
  * @brief Formats PasswordChangeRequired message into JSON
- * Message body: The password provided for this account must be changed
- * before access is granted.  PATCH the 'Password' property for this
- * account located at the target URI '%1' to complete this process.
+ * Message body: "The password provided for this account must be changed before
+ * access is granted.  PATCH the Password property for this account located at
+ * the target URI <arg1> to complete this process."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message PasswordChangeRequired formatted to JSON */
-
 nlohmann::json passwordChangeRequired(const boost::urls::url_view_base& arg1);
 
 void passwordChangeRequired(crow::Response& res,
@@ -1080,7 +1078,8 @@
 
 /**
  * @brief Formats InvalidUpload message into JSON
- * Message body: Invalid file uploaded to %1: %2.*
+ * Message body: "Invalid file uploaded to <arg1>: <arg2>.*"
+ *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  * @param[in] arg2 Parameter of message that will replace %2 in its body.
  *
@@ -1093,7 +1092,9 @@
 /**
  * @brief Formats InsufficientStorage message into JSON
  * Message body: "Insufficient storage or memory available to complete the
- *  request."
+ * request."
+ *
+ *
  * @returns Message InsufficientStorage formatted to JSON */
 nlohmann::json insufficientStorage();
 
@@ -1101,7 +1102,9 @@
 
 /**
  * @brief Formats OperationNotAllowed message into JSON
- * Message body: "he HTTP method is not allowed on this resource."
+ * Message body: "The HTTP method is not allowed on this resource."
+ *
+ *
  * @returns Message OperationNotAllowed formatted to JSON */
 nlohmann::json operationNotAllowed();
 
@@ -1109,8 +1112,12 @@
 
 /**
  * @brief Formats ArraySizeTooLong message into JSON
- * Message body: "Indicates that a string value passed to the given resource
- * exceeded its length limit."
+ * Message body: "The array provided for property <arg1> exceeds the size limit
+ * <arg2>."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ * @param[in] arg2 Parameter of message that will replace %2 in its body.
+ *
  * @returns Message ArraySizeTooLong formatted to JSON */
 nlohmann::json arraySizeTooLong(std::string_view arg1, uint64_t arg2);
 
@@ -1119,21 +1126,354 @@
 
 /**
  * @brief Formats GenerateSecretKeyRequired message into JSON
- * Message body: Secret key needs to be generated for the account before
- * accessing the service. Account has to provide a time based OTP from the
- * device configured with the secret key before access is granted. The secret
- * key can be generated with a `POST` to the `GenerateSecretKey` action for
- * the account located at the target URI '%1'.
+ * Message body: "The Time-based One-Time Password (TOTP) secret key for this
+ * account must be generated before access is granted.  Perform the
+ * GenerateSecretKey action at URI <arg1> and retain the secret key from the
+ * response."
  *
  * @param[in] arg1 Parameter of message that will replace %1 in its body.
  *
  * @returns Message GenerateSecretKeyRequired formatted to JSON */
-
 nlohmann::json
     generateSecretKeyRequired(const boost::urls::url_view_base& arg1);
 
 void generateSecretKeyRequired(crow::Response& res,
                                const boost::urls::url_view_base& arg1);
-} // namespace messages
 
+/**
+ * @brief Formats PropertyNotUpdated message into JSON
+ * Message body: "The property <arg1> was not updated due to an internal service
+ * error.  The service is still operational."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message PropertyNotUpdated formatted to JSON */
+nlohmann::json propertyNotUpdated(std::string_view arg1);
+
+void propertyNotUpdated(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats InvalidJSON message into JSON
+ * Message body: "The request body submitted is invalid JSON starting at line
+ * <arg1> and could not be parsed by the receiving service."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message InvalidJSON formatted to JSON */
+nlohmann::json invalidJSON(std::string_view arg1);
+
+void invalidJSON(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats ActionParameterValueOutOfRange message into JSON
+ * Message body: "The value <arg1> for the parameter <arg2> in the action <arg3>
+ * is not in the supported range of acceptable values."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ * @param[in] arg2 Parameter of message that will replace %2 in its body.
+ * @param[in] arg3 Parameter of message that will replace %3 in its body.
+ *
+ * @returns Message ActionParameterValueOutOfRange formatted to JSON */
+nlohmann::json actionParameterValueOutOfRange(
+    std::string_view arg1, std::string_view arg2, std::string_view arg3);
+
+void actionParameterValueOutOfRange(crow::Response& res, std::string_view arg1,
+                                    std::string_view arg2,
+                                    std::string_view arg3);
+
+/**
+ * @brief Formats ArraySizeTooShort message into JSON
+ * Message body: "The array provided for property <arg1> is under the minimum
+ * size limit <arg2>."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ * @param[in] arg2 Parameter of message that will replace %2 in its body.
+ *
+ * @returns Message ArraySizeTooShort formatted to JSON */
+nlohmann::json arraySizeTooShort(std::string_view arg1, std::string_view arg2);
+
+void arraySizeTooShort(crow::Response& res, std::string_view arg1,
+                       std::string_view arg2);
+
+/**
+ * @brief Formats QueryParameterValueError message into JSON
+ * Message body: "The value for the parameter <arg1> is invalid."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message QueryParameterValueError formatted to JSON */
+nlohmann::json queryParameterValueError(std::string_view arg1);
+
+void queryParameterValueError(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats QueryParameterUnsupported message into JSON
+ * Message body: "Query parameter <arg1> is not supported."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message QueryParameterUnsupported formatted to JSON */
+nlohmann::json queryParameterUnsupported(std::string_view arg1);
+
+void queryParameterUnsupported(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats PayloadTooLarge message into JSON
+ * Message body: "The supplied payload exceeds the maximum size supported by the
+ * service."
+ *
+ *
+ * @returns Message PayloadTooLarge formatted to JSON */
+nlohmann::json payloadTooLarge();
+
+void payloadTooLarge(crow::Response& res);
+
+/**
+ * @brief Formats MissingOrMalformedPart message into JSON
+ * Message body: "The multipart request contains malformed parts or is missing
+ * required parts."
+ *
+ *
+ * @returns Message MissingOrMalformedPart formatted to JSON */
+nlohmann::json missingOrMalformedPart();
+
+void missingOrMalformedPart(crow::Response& res);
+
+/**
+ * @brief Formats InvalidURI message into JSON
+ * Message body: "The URI <arg1> was not found."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message InvalidURI formatted to JSON */
+nlohmann::json invalidURI(std::string_view arg1);
+
+void invalidURI(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats StringValueTooShort message into JSON
+ * Message body: "The string <arg1> was under the minimum required length
+ * <arg2>."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ * @param[in] arg2 Parameter of message that will replace %2 in its body.
+ *
+ * @returns Message StringValueTooShort formatted to JSON */
+nlohmann::json stringValueTooShort(std::string_view arg1,
+                                   std::string_view arg2);
+
+void stringValueTooShort(crow::Response& res, std::string_view arg1,
+                         std::string_view arg2);
+
+/**
+ * @brief Formats ResetRecommended message into JSON
+ * Message body: "In order to recover from errors, a component reset is
+ * recommended with the Reset action URI <arg1> and ResetType <arg2>."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ * @param[in] arg2 Parameter of message that will replace %2 in its body.
+ *
+ * @returns Message ResetRecommended formatted to JSON */
+nlohmann::json resetRecommended(std::string_view arg1, std::string_view arg2);
+
+void resetRecommended(crow::Response& res, std::string_view arg1,
+                      std::string_view arg2);
+
+/**
+ * @brief Formats ActionParameterValueConflict message into JSON
+ * Message body: "The parameter <arg1> with the requested value of <arg2> does
+ * not meet the constraints of the implementation."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ * @param[in] arg2 Parameter of message that will replace %2 in its body.
+ *
+ * @returns Message ActionParameterValueConflict formatted to JSON */
+nlohmann::json
+    actionParameterValueConflict(std::string_view arg1, std::string_view arg2);
+
+void actionParameterValueConflict(crow::Response& res, std::string_view arg1,
+                                  std::string_view arg2);
+
+/**
+ * @brief Formats HeaderMissing message into JSON
+ * Message body: "Required header <arg1> is missing in the request."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message HeaderMissing formatted to JSON */
+nlohmann::json headerMissing(std::string_view arg1);
+
+void headerMissing(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats HeaderInvalid message into JSON
+ * Message body: "Header <arg1> is invalid."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message HeaderInvalid formatted to JSON */
+nlohmann::json headerInvalid(std::string_view arg1);
+
+void headerInvalid(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats UndeterminedFault message into JSON
+ * Message body: "An undetermined fault condition was reported by <arg1>."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message UndeterminedFault formatted to JSON */
+nlohmann::json undeterminedFault(std::string_view arg1);
+
+void undeterminedFault(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats ConditionInRelatedResource message into JSON
+ * Message body: "One or more conditions exist in a related resource.  See the
+ * OriginOfCondition property."
+ *
+ *
+ * @returns Message ConditionInRelatedResource formatted to JSON */
+nlohmann::json conditionInRelatedResource();
+
+void conditionInRelatedResource(crow::Response& res);
+
+/**
+ * @brief Formats RestrictedRole message into JSON
+ * Message body: "The operation was not successful because the role <arg1> is
+ * restricted."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message RestrictedRole formatted to JSON */
+nlohmann::json restrictedRole(std::string_view arg1);
+
+void restrictedRole(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats RestrictedPrivilege message into JSON
+ * Message body: "The operation was not successful because the privilege <arg1>
+ * is restricted."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message RestrictedPrivilege formatted to JSON */
+nlohmann::json restrictedPrivilege(std::string_view arg1);
+
+void restrictedPrivilege(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats PropertyDeprecated message into JSON
+ * Message body: "The deprecated property <arg1> was included in the request
+ * body."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message PropertyDeprecated formatted to JSON */
+nlohmann::json propertyDeprecated(std::string_view arg1);
+
+void propertyDeprecated(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats ResourceDeprecated message into JSON
+ * Message body: "The operation was performed on a deprecated resource <arg1>."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message ResourceDeprecated formatted to JSON */
+nlohmann::json resourceDeprecated(std::string_view arg1);
+
+void resourceDeprecated(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats PropertyValueDeprecated message into JSON
+ * Message body: "The value <arg1> for the property <arg2> is deprecated."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ * @param[in] arg2 Parameter of message that will replace %2 in its body.
+ *
+ * @returns Message PropertyValueDeprecated formatted to JSON */
+nlohmann::json propertyValueDeprecated(std::string_view arg1,
+                                       std::string_view arg2);
+
+void propertyValueDeprecated(crow::Response& res, std::string_view arg1,
+                             std::string_view arg2);
+
+/**
+ * @brief Formats ActionDeprecated message into JSON
+ * Message body: "The action <arg1> is deprecated."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message ActionDeprecated formatted to JSON */
+nlohmann::json actionDeprecated(std::string_view arg1);
+
+void actionDeprecated(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats NetworkNameResolutionNotConfigured message into JSON
+ * Message body: "Network name resolution is not configured on this service."
+ *
+ *
+ * @returns Message NetworkNameResolutionNotConfigured formatted to JSON */
+nlohmann::json networkNameResolutionNotConfigured();
+
+void networkNameResolutionNotConfigured(crow::Response& res);
+
+/**
+ * @brief Formats NetworkNameResolutionNotSupported message into JSON
+ * Message body: "Resolution of network-based names is not supported by this
+ * service."
+ *
+ *
+ * @returns Message NetworkNameResolutionNotSupported formatted to JSON */
+nlohmann::json networkNameResolutionNotSupported();
+
+void networkNameResolutionNotSupported(crow::Response& res);
+
+/**
+ * @brief Formats AuthenticationTokenRequired message into JSON
+ * Message body: "The request could not be performed because an authentication
+ * token was not provided."
+ *
+ *
+ * @returns Message AuthenticationTokenRequired formatted to JSON */
+nlohmann::json authenticationTokenRequired();
+
+void authenticationTokenRequired(crow::Response& res);
+
+/**
+ * @brief Formats OneTimePasscodeSent message into JSON
+ * Message body: "A one-time passcode was sent to: <arg1>.  Supply the passcode
+ * as the `Token` property in the request to create a session."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message OneTimePasscodeSent formatted to JSON */
+nlohmann::json oneTimePasscodeSent(std::string_view arg1);
+
+void oneTimePasscodeSent(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats LicenseRequired message into JSON
+ * Message body: "A license is required for this operation: <arg1>."
+ *
+ * @param[in] arg1 Parameter of message that will replace %1 in its body.
+ *
+ * @returns Message LicenseRequired formatted to JSON */
+nlohmann::json licenseRequired(std::string_view arg1);
+
+void licenseRequired(crow::Response& res, std::string_view arg1);
+
+/**
+ * @brief Formats PropertyModified message into JSON
+ * Message body: "One or more properties were successfully modified."
+ *
+ *
+ * @returns Message PropertyModified formatted to JSON */
+nlohmann::json propertyModified();
+
+void propertyModified(crow::Response& res);
+
+} // namespace messages
 } // namespace redfish
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index 4c1e7b8..29a40f1 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -2,6 +2,7 @@
 import argparse
 import json
 import os
+from collections import OrderedDict
 
 import requests
 
@@ -47,7 +48,7 @@
     url = "https://redfish.dmtf.org/registries/{}".format(dmtf_name)
     dmtf = requests.get(url, proxies=proxies)
     dmtf.raise_for_status()
-    json_file = json.loads(dmtf.text)
+    json_file = json.loads(dmtf.text, object_pairs_hook=OrderedDict)
     path = os.path.join(include_path, header_name)
     return (path, json_file, type_name, url)
 
@@ -187,6 +188,251 @@
 )
 
 
+def get_old_index(entry):
+    old_order = [
+        "ResourceInUse",
+        "MalformedJSON",
+        "ResourceMissingAtURI",
+        "ActionParameterValueFormatError",
+        "ActionParameterValueNotInList",
+        "InternalError",
+        "UnrecognizedRequestBody",
+        "ResourceAtUriUnauthorized",
+        "ActionParameterUnknown",
+        "ResourceCannotBeDeleted",
+        "PropertyDuplicate",
+        "ServiceTemporarilyUnavailable",
+        "ResourceAlreadyExists",
+        "AccountForSessionNoLongerExists",
+        "CreateFailedMissingReqProperties",
+        "PropertyValueFormatError",
+        "PropertyValueNotInList",
+        "PropertyValueOutOfRange",
+        "ResourceAtUriInUnknownFormat",
+        "ServiceDisabled",
+        "ServiceInUnknownState",
+        "EventSubscriptionLimitExceeded",
+        "ActionParameterMissing",
+        "StringValueTooLong",
+        "SessionTerminated",
+        "SubscriptionTerminated",
+        "ResourceTypeIncompatible",
+        "ResetRequired",
+        "ChassisPowerStateOnRequired",
+        "ChassisPowerStateOffRequired",
+        "PropertyValueConflict",
+        "PropertyValueResourceConflict",
+        "PropertyValueExternalConflict",
+        "PropertyValueIncorrect",
+        "ResourceCreationConflict",
+        "MaximumErrorsExceeded",
+        "PreconditionFailed",
+        "PreconditionRequired",
+        "OperationFailed",
+        "OperationTimeout",
+        "PropertyValueTypeError",
+        "PropertyValueError",
+        "ResourceNotFound",
+        "CouldNotEstablishConnection",
+        "PropertyNotWritable",
+        "QueryParameterValueTypeError",
+        "ServiceShuttingDown",
+        "ActionParameterDuplicate",
+        "ActionParameterNotSupported",
+        "SourceDoesNotSupportProtocol",
+        "StrictAccountTypes",
+        "AccountRemoved",
+        "AccessDenied",
+        "QueryNotSupported",
+        "CreateLimitReachedForResource",
+        "GeneralError",
+        "Success",
+        "Created",
+        "NoOperation",
+        "PropertyUnknown",
+        "NoValidSession",
+        "InvalidObject",
+        "ResourceInStandby",
+        "ActionParameterValueTypeError",
+        "ActionParameterValueError",
+        "SessionLimitExceeded",
+        "ActionNotSupported",
+        "InvalidIndex",
+        "EmptyJSON",
+        "QueryNotSupportedOnResource",
+        "QueryNotSupportedOnOperation",
+        "QueryCombinationInvalid",
+        "EventBufferExceeded",
+        "InsufficientPrivilege",
+        "PropertyValueModified",
+        "AccountNotModified",
+        "QueryParameterValueFormatError",
+        "PropertyMissing",
+        "ResourceExhaustion",
+        "AccountModified",
+        "QueryParameterOutOfRange",
+        "PasswordChangeRequired",
+        "InvalidUpload",
+        "InsufficientStorage",
+        "OperationNotAllowed",
+        "ArraySizeTooLong",
+        "Invalid File",
+        "GenerateSecretKeyRequired",
+    ]
+
+    if entry[0] in old_order:
+        return old_order.index(entry[0])
+    else:
+        return 999999
+
+
+def create_error_registry(entry):
+
+    arg_as_url = {
+        "AccessDenied": [1],
+        "CouldNotEstablishConnection": [1],
+        "GenerateSecretKeyRequired": [1],
+        "InvalidObject": [1],
+        "PasswordChangeRequired": [1],
+        "PropertyValueResourceConflict": [3],
+        "ResetRequired": [1],
+        "ResourceAtUriInUnknownFormat": [1],
+        "ResourceAtUriUnauthorized": [1],
+        "ResourceCreationConflict": [1],
+        "ResourceMissingAtURI": [1],
+        "SourceDoesNotSupportProtocol": [1],
+    }
+
+    arg_as_json = {
+        "ActionParameterValueError": [1],
+        "ActionParameterValueFormatError": [1],
+        "ActionParameterValueTypeError": [1],
+        "PropertyValueExternalConflict": [2],
+        "PropertyValueFormatError": [1],
+        "PropertyValueIncorrect": [2],
+        "PropertyValueModified": [2],
+        "PropertyValueNotInList": [1],
+        "PropertyValueOutOfRange": [1],
+        "PropertyValueResourceConflict": [2],
+        "PropertyValueTypeError": [1],
+        "QueryParameterValueFormatError": [1],
+        "QueryParameterValueTypeError": [1],
+    }
+
+    arg_as_int = {
+        "StringValueTooLong": [2],
+    }
+
+    arg_as_uint64 = {
+        "ArraySizeTooLong": [2],
+    }
+    arg_as_int64 = {
+        "InvalidIndex": [1],
+    }
+
+    file, json_dict, namespace, url = entry
+
+    # Note, this message doesn't exist in DMTF.  Needs cleaned up at some point
+    json_dict["Messages"]["InvalidUpload"] = {
+        "Message": "Invalid file uploaded to %1: %2.*",
+        "ParamTypes": ["string", "string"],
+    }
+
+    messages = OrderedDict(
+        sorted(json_dict["Messages"].items(), key=get_old_index)
+    )
+    error_messages_hpp = os.path.join(
+        SCRIPT_DIR, "..", "redfish-core", "include", "error_messages.hpp"
+    )
+    with open(
+        error_messages_hpp,
+        "w",
+    ) as out:
+        out.write(PRAGMA_ONCE)
+        out.write(WARNING)
+        out.write(
+            """
+
+#include "http_response.hpp"
+
+#include <boost/url/url_view_base.hpp>
+#include <nlohmann/json.hpp>
+
+#include <cstdint>
+#include <source_location>
+#include <string>
+#include <string_view>
+
+// IWYU pragma: no_forward_declare crow::Response
+
+namespace redfish
+{
+
+namespace messages
+{
+
+    constexpr const char* messageVersionPrefix = "Base.1.11.0.";
+    constexpr const char* messageAnnotation = "@Message.ExtendedInfo";
+
+    /**
+    * @brief Moves all error messages from the |source| JSON to |target|
+    */
+    void moveErrorsToErrorJson(nlohmann::json& target, nlohmann::json& source);
+
+"""
+        )
+
+        for entry_id, entry in messages.items():
+            message = entry["Message"]
+            for index in range(1, 10):
+                message = message.replace(f"'%{index}'", f"<arg{index}>")
+                message = message.replace(f"%{index}", f"<arg{index}>")
+
+            out.write("/**\n")
+            out.write(f"* @brief Formats {entry_id} message into JSON\n")
+            out.write(f'* Message body: "{message}"\n')
+            out.write("*\n")
+            arg_index = 0
+            for arg_index, arg in enumerate(entry.get("ParamTypes", [])):
+                arg_index += 1
+
+                out.write(
+                    f"* @param[in] arg{arg_index} Parameter of message that will replace %{arg_index} in its body.\n"
+                )
+            out.write("*\n")
+            out.write(f"* @returns Message {entry_id} formatted to JSON */\n")
+
+            args = []
+            for arg_index, arg in enumerate(entry.get("ParamTypes", [])):
+                arg_index += 1
+                if arg_index in arg_as_url.get(entry_id, []):
+                    typename = "const boost::urls::url_view_base&"
+                elif arg_index in arg_as_json.get(entry_id, []):
+                    typename = "const nlohmann::json&"
+                elif arg_index in arg_as_int.get(entry_id, []):
+                    typename = "int"
+                elif arg_index in arg_as_uint64.get(entry_id, []):
+                    typename = "uint64_t"
+                elif arg_index in arg_as_int64.get(entry_id, []):
+                    typename = "int64_t"
+                else:
+                    typename = "std::string_view"
+                args.append(f"{typename} arg{arg_index}")
+            function_name = entry_id[0].lower() + entry_id[1:]
+            arg = ", ".join(args)
+            out.write(f"nlohmann::json {function_name}({arg});\n\n")
+            args.insert(0, "crow::Response& res")
+            if entry_id == "InternalError":
+                args.append(
+                    "std::source_location location = std::source_location::current()"
+                )
+            arg = ", ".join(args)
+            out.write(f"void {function_name}({arg});\n\n")
+        out.write("    }\n")
+        out.write("}\n")
+    os.system(f"clang-format -i {error_messages_hpp}")
+
+
 def make_privilege_registry():
     path, json_file, type_name, url = make_getter(
         "Redfish_1.5.0_PrivilegeRegistry.json",
@@ -293,6 +539,8 @@
 
     update_registries(files)
 
+    create_error_registry(files[0])
+
     if "privilege" in registries:
         make_privilege_registry()