Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for bigints in JSON ( store as string ) #3534

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

vladpaiu
Copy link
Member

@vladpaiu vladpaiu commented Dec 3, 2024

Summary
Add support for bigints in JSON

Details
In certain scenarios ( like #3533 ), we are processing JSONs which have bigints in them, so we need to properly parse those and export sub-fields in the opensips scripts.

Solution
Expose bigints in JSON as string to the opensips script.

Compatibility
Backwards compatible

@vladpaiu vladpaiu added this to the 3.6-dev milestone Dec 3, 2024
@liviuchircu liviuchircu self-assigned this Dec 5, 2024
Copy link
Member

@liviuchircu liviuchircu left a comment

Choose a reason for hiding this comment

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

Undefined variable: int64_t int_value;. There is also a double ;; typo in the middle. LGTM otherwise.

@liviuchircu liviuchircu merged commit 3197a61 into OpenSIPS:master Dec 5, 2024
49 checks passed
@liviuchircu
Copy link
Member

Let's merge this, as it fixes a big limitation, at the end of the day. Still, until we have 64bit integer support at opensips.cfg level, script developers will have to deal with the fact that this solution lacks symmetry... i.e. if I re-serialize a freshly parsed $json variable back to a JSON string, the module will not be able to distinguish between a "OpenSIPS-quoted 64-bit integer" or a "string of digits longer than 10".

@vladpaiu vladpaiu deleted the json_bigint branch January 3, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants