From b0a84bd1ea9cbb45e7eceb01295ccdfdfd54d9ee Mon Sep 17 00:00:00 2001 From: AlinsRan Date: Mon, 20 Jul 2026 14:03:16 +0800 Subject: [PATCH] feat: release v1.0.6 Drop the unpinned "lua-cjson" dependency from the rockspecs. The library only requires cjson.safe, which OpenResty always bundles. Declaring lua-cjson as a LuaRocks dependency makes consumers install lua-cjson 2.1.0.10-1 (the latest release on luarocks.org; 2.1.0.11 was never published there) into their rocks tree, where it shadows the OpenResty bundled 2.1.0.11 whenever the tree comes first on lua_package_cpath. 2.1.0.10 misses openresty/lua-cjson#82: the empty_array sentinel is pushed through a 47-bit pointer mask but compared unmasked, so on platforms that map shared libraries above 2^47 (arm64 Linux with 48-bit VA, e.g. Apple Silicon) the encoder drops the value and emits invalid JSON such as {"x":}. See apache/apisix#13593. Removing the declaration only narrows the install set; no module code or API changes. CI has never installed lua-cjson, so the test suite has always run against the bundled version. Signed-off-by: AlinsRan --- README.md | 2 +- ...a-resty-openapi-validator-1.0.6-1.rockspec | 38 +++++++++++++++++++ ...ty-openapi-validator-master-0.1-0.rockspec | 1 - 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 rockspec/lua-resty-openapi-validator-1.0.6-1.rockspec diff --git a/README.md b/README.md index 71708fb..a659cdf 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Install - [api7/jsonschema](https://github.com/api7/jsonschema) — JSON Schema Draft 4/6/7 validation - [lua-resty-radixtree](https://github.com/api7/lua-resty-radixtree) — radix tree path routing -- [lua-cjson](https://github.com/openresty/lua-cjson) — JSON encoding/decoding +- [lua-cjson](https://github.com/openresty/lua-cjson) — JSON encoding/decoding (bundled with OpenResty, not installed via LuaRocks) > install by luarocks diff --git a/rockspec/lua-resty-openapi-validator-1.0.6-1.rockspec b/rockspec/lua-resty-openapi-validator-1.0.6-1.rockspec new file mode 100644 index 0000000..9c6d4a4 --- /dev/null +++ b/rockspec/lua-resty-openapi-validator-1.0.6-1.rockspec @@ -0,0 +1,38 @@ +package = "lua-resty-openapi-validator" +version = "1.0.6-1" + +source = { + url = "git+https://github.com/api7/lua-resty-openapi-validator.git", + tag = "v1.0.6", +} + +description = { + summary = "Pure Lua OpenAPI request validator for OpenResty", + detailed = [[ + Validates HTTP requests against OpenAPI 3.0 and 3.1 specifications + using lua-resty-radixtree for path matching and api7/jsonschema for + schema validation. No Go FFI or external processes required. + ]], + homepage = "https://github.com/api7/lua-resty-openapi-validator", + license = "Apache-2.0", +} + +dependencies = { + "lua >= 5.1", + "jsonschema", + "lua-resty-radixtree", +} + +build = { + type = "builtin", + modules = { + ["resty.openapi_validator"] = "lib/resty/openapi_validator/init.lua", + ["resty.openapi_validator.loader"] = "lib/resty/openapi_validator/loader.lua", + ["resty.openapi_validator.refs"] = "lib/resty/openapi_validator/refs.lua", + ["resty.openapi_validator.normalize"] = "lib/resty/openapi_validator/normalize.lua", + ["resty.openapi_validator.router"] = "lib/resty/openapi_validator/router.lua", + ["resty.openapi_validator.params"] = "lib/resty/openapi_validator/params.lua", + ["resty.openapi_validator.body"] = "lib/resty/openapi_validator/body.lua", + ["resty.openapi_validator.errors"] = "lib/resty/openapi_validator/errors.lua", + }, +} diff --git a/rockspec/lua-resty-openapi-validator-master-0.1-0.rockspec b/rockspec/lua-resty-openapi-validator-master-0.1-0.rockspec index d6f4fb5..6913357 100644 --- a/rockspec/lua-resty-openapi-validator-master-0.1-0.rockspec +++ b/rockspec/lua-resty-openapi-validator-master-0.1-0.rockspec @@ -17,7 +17,6 @@ dependencies = { "lua >= 5.1", "jsonschema", "lua-resty-radixtree", - "lua-cjson", } build = {