api7 / jsonschema

Pure Lua JSON schema validator for Lua/LuaJIT
https://www.apiseven.com/
Apache License 2.0
119 stars 28 forks source link

loadstring deprecated in Lua 5.2 and removed in higher versions #80

Closed oktoberfest6 closed 2 years ago

oktoberfest6 commented 2 years ago

Hi,

jsonschema uses the function loadstring(). This function has been deprecated in Lua 5.2 and is not available in Lua >= 5.3. The load() function can be used as it accepts the same arguments as loadstring().

Can you adapt the code so that it works with the different Lua 5.X versions ?

Regards

tzssangglass commented 2 years ago

fixed by: https://github.com/api7/jsonschema/pull/72?

oktoberfest6 commented 2 years ago

Yes this pull request fix the issue. But it seems that the version 0.9.8 does not include this fix (I should honestly say that I'm not familiar with git)

tzssangglass commented 2 years ago

But it seems that the version 0.9.8 does not include this fix (I should honestly say that I'm not familiar with git)

Can't you use the latest version?

oktoberfest6 commented 2 years ago

I'm installing it through luarocks. And the version registered in luarocks is the 0.9.8. As this issue will be fixed in the next release, I can easily patch my code until the new release come.