Skip to content

MOD-14324 C API for getting array slice and type#1521

Merged
AvivDavid23 merged 10 commits intomasterfrom
MOD-14324-json-json-homogeneous-fp-arrays-c-api-for-json-set-hfpa
Mar 30, 2026
Merged

MOD-14324 C API for getting array slice and type#1521
AvivDavid23 merged 10 commits intomasterfrom
MOD-14324-json-json-homogeneous-fp-arrays-c-api-for-json-set-hfpa

Conversation

@AvivDavid23
Copy link
Copy Markdown
Contributor

@AvivDavid23 AvivDavid23 commented Mar 18, 2026

Note

Medium Risk
Extends the public C API with a new getArray entry that returns raw array buffer pointers and type tags, which is FFI- and memory-safety sensitive if callers misuse lifetimes or heterogeneous arrays.

Overview
Adds RedisJSON C API v7 support for retrieving an array’s underlying contiguous buffer plus its element type.

This introduces a shared JSONArrayType enum in json_path, extends the SelectValue trait with get_array/get_array_type, implements them for both serde_json::Value and ijson::IValue (including typed numeric array slices), and wires a new exported JSONAPI_getArray/getArray function through rejson_api.h (bumping RedisJSONAPI_LATEST_API_VER to 7). Unit tests were added to validate returned pointers, lengths, and type tags across heterogeneous and typed arrays.

Written by Cursor Bugbot for commit fff92bd. This will update automatically on new commits. Configure here.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 1.58730% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.84%. Comparing base (c01a9df) to head (fff92bd).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
json_path/src/json_node.rs 0.00% 36 Missing ⚠️
redis_json/src/c_api.rs 3.70% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1521      +/-   ##
==========================================
- Coverage   78.05%   76.84%   -1.21%     
==========================================
  Files          15       15              
  Lines        3942     4004      +62     
==========================================
  Hits         3077     3077              
- Misses        865      927      +62     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AvivDavid23 AvivDavid23 requested a review from oshadmi March 24, 2026 12:56
@AvivDavid23 AvivDavid23 requested a review from oshadmi March 26, 2026 06:47
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@AvivDavid23 AvivDavid23 requested a review from oshadmi March 26, 2026 09:23
@AvivDavid23 AvivDavid23 merged commit 9c66b9a into master Mar 30, 2026
36 of 37 checks passed
@AvivDavid23 AvivDavid23 deleted the MOD-14324-json-json-homogeneous-fp-arrays-c-api-for-json-set-hfpa branch March 30, 2026 08:13
AvivDavid23 added a commit that referenced this pull request Mar 30, 2026
* MOD-14324 C API for getting array slice and type

* remove mistakenly added function

* cargo fmt

* CR

* CR

* typo

* add comment

* add namespace for enum

* test vars init
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.

2 participants