# HG changeset patch # User jbe # Date 1407771700 -7200 # Node ID 31f775ea5e24a9243dd5c7f1916afdafbc1797b3 # Parent 654ddbcc49d08cbbe4ae88ebdaba06b3c85f2d51 Fix in JSON documentation diff -r 654ddbcc49d0 -r 31f775ea5e24 libraries/json/json.autodoc.lua --- a/libraries/json/json.autodoc.lua Mon Aug 11 17:38:12 2014 +0200 +++ b/libraries/json/json.autodoc.lua Mon Aug 11 17:41:40 2014 +0200 @@ -81,13 +81,13 @@ --[[-- -type_string_or_nil -- "object", "array", "string", "number", "boolean", "null", string "nil", or nil -json.get( - document, -- a JSON value (usually object or array) - key1, -- first path element (e.g. a string key to descent into an object) - key2, -- second path element (e.g. an integer key to descent into an array) +type_string_or_nil = -- "object", "array", "string", "number", "boolean", "null", string "nil", or nil +json.type( + document, -- a JSON value (usually object or array) + key1, -- first path element (e.g. a string key to descent into an object) + key2, -- second path element (e.g. an integer key to descent into an array) ..., - last_key -- last path element + last_key -- last path element ) Determines the type of a value in a JSON document by following a given path that may contain string keys (to descent into an object) or integer keys (to descent into an array). If the path but its last path element could be followed, then the string "nil" is returned. If the previous path elements could not be followed, then nil itself is returned. Otherwise the type of the value is returned, whereas the string "null" indicates a JSON null value. This function also works on plain Lua tables instead of JSON documents.