Skip to content

Commit

Permalink
fix(rockspec): make lua-cjson dependency explicit (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske authored Sep 21, 2023
1 parent d1c8586 commit 478d1fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions lua-resty-ljsonschema-scm-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ description = {
dependencies = {
"lua >= 5.1",
"net-url",
"lua-cjson",
}

build = {
Expand Down
12 changes: 2 additions & 10 deletions src/resty/ljsonschema/metaschema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,8 @@ local metaschema = [[



local cjson = require "cjson"


-- test decode with array_mt, to not change global settings
local t = cjson.decode("[]")
local status = getmetatable(t) == cjson.array_mt

local cjson = require("cjson").new()
cjson.decode_array_with_array_mt(true)
local schema = cjson.decode(metaschema)
cjson.decode_array_with_array_mt(status) -- restore old state

return schema
return cjson.decode(metaschema)

0 comments on commit 478d1fa

Please sign in to comment.