Skip to content

Conversation

@Kasen
Copy link
Contributor

@Kasen Kasen commented Dec 2, 2021

LuaJIT has a couple of 64bit integers, such as int64 and uint64. These types are represented as cdata, not numbers. This PR introduces the ability to check these types as jsonschema integer.

@CLAassistant
Copy link

CLAassistant commented Dec 2, 2021

CLA assistant check
All committers have signed the CLA.

@Kasen Kasen changed the title Add support of LuaJIT 64bit integer types feat: Add support of LuaJIT 64bit integer types Dec 2, 2021
elseif jsontype == 'integer' then
return sformat(' (%s == "number" and %s(%s, 1.0) == 0.0) ',
datatype, ctx:libfunc('math.fmod'), ctx:param(1))
return sformat(' ((%s == "number" or (%s == "cdata" and tonumber(%s) ~= nil)) and %s %% 1.0 == 0.0) ',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need a test case to check it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a couple of tests

@spacewander spacewander merged commit 72d26fe into api7:master Dec 5, 2021
@membphis
Copy link
Contributor

membphis commented Dec 6, 2021

many thx @Kasen
nice job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants