json: input data for json is a string, not buffer data. allow -1 for \0 terminated strings.