Allow trailing comma in objects
diff --git a/include/json/json_features.h b/include/json/json_features.h
index ba25e8d..8ba1e8f 100644
--- a/include/json/json_features.h
+++ b/include/json/json_features.h
@@ -23,6 +23,7 @@
/** \brief A configuration that allows all features and assumes all strings
* are UTF-8.
* - C & C++ comments are allowed
+ * - Trailing commas in objects and arrays are allowed.
* - Root object can be any JSON value
* - Assumes Value strings are encoded in UTF-8
*/
@@ -31,6 +32,7 @@
/** \brief A configuration that is strictly compatible with the JSON
* specification.
* - Comments are forbidden.
+ * - Trailing commas in objects and arrays are forbidden.
* - Root object must be either an array or an object value.
* - Assumes Value strings are encoded in UTF-8
*/
@@ -43,6 +45,9 @@
/// \c true if comments are allowed. Default: \c true.
bool allowComments_{true};
+ /// \c true if trailing commas in objects and arrays are allowed. Default \c true.
+ bool allowTrailingCommas_{true};
+
/// \c true if root must be either an array or an object value. Default: \c
/// false.
bool strictRoot_{false};
diff --git a/include/json/reader.h b/include/json/reader.h
index 359c1eb..0b38176 100644
--- a/include/json/reader.h
+++ b/include/json/reader.h
@@ -299,6 +299,8 @@
* if allowComments is false.
* - `"allowComments": false or true`
* - true if comments are allowed.
+ * - `"allowTrailingCommas": false or true`
+ * - true if trailing commas in objects and arrays are allowed.
* - `"strictRoot": false or true`
* - true if root must be either an array or an object value
* - `"allowDroppedNullPlaceholders": false or true`