diff mod_rest/jsonmap.lib.lua @ 3885:1ec45dbc7db5

mod_rest: Return an error for unknown fields in JSON input Helps you discover typos and such.
author Kim Alvefur <zash@zash.se>
date Fri, 07 Feb 2020 20:49:07 +0100
parents 5d7df207dc2b
children b64b08b7bf8e
line wrap: on
line diff
--- a/mod_rest/jsonmap.lib.lua	Thu Feb 06 21:03:17 2020 +0000
+++ b/mod_rest/jsonmap.lib.lua	Fri Feb 07 20:49:07 2020 +0100
@@ -464,6 +464,8 @@
 			elseif typ[1] == "func" then
 				s:add_child(typ[5](v)):up();
 			end
+		else
+			return nil, "unknown-field";
 		end
 	end