diff --git a/lib/json.cpp b/lib/json.cpp
index d98c3e8f1..696d0b606 100644
--- a/lib/json.cpp
+++ b/lib/json.cpp
@@ -497,6 +497,11 @@ JSON::Value::Value(int64_t val){
   myType = INTEGER;
   intVal = val;
 }
+/// Sets this JSON::Value to the given integer.
+JSON::Value::Value(size_t val){
+  myType = INTEGER;
+  intVal = val;
+}
 
 /// Sets this JSON::Value to the given double.
 JSON::Value::Value(double val){
@@ -692,6 +697,11 @@ JSON::Value &JSON::Value::operator=(const uint64_t &rhs){
   return ((*this) = (int64_t)rhs);
 }
 
+/// Sets this JSON::Value to the given integer.
+JSON::Value &JSON::Value::operator=(const size_t &rhs){
+  return ((*this) = (int64_t)rhs);
+}
+
 /// Sets this JSON::Value to the given double.
 JSON::Value &JSON::Value::operator=(const double &rhs){
   null();
diff --git a/lib/json.h b/lib/json.h
index 20799b9bc..6d1dd2537 100644
--- a/lib/json.h
+++ b/lib/json.h
@@ -46,6 +46,7 @@ namespace JSON{
     Value(int64_t val);
     Value(uint32_t val);
     Value(uint64_t val);
+    Value(size_t val);
     Value(double val);
     Value(bool val);
     // comparison operators
@@ -63,6 +64,7 @@ namespace JSON{
     Value &operator=(const int32_t &rhs);
     Value &operator=(const uint64_t &rhs);
     Value &operator=(const uint32_t &rhs);
+    Value &operator=(const size_t &rhs);
     Value &operator=(const double &rhs);
     Value &operator=(const bool &rhs);
     // converts to basic types