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

few tweaks for objects api #190

Merged
merged 8 commits into from
Jul 30, 2024
Merged

few tweaks for objects api #190

merged 8 commits into from
Jul 30, 2024

Conversation

Xavrax
Copy link
Contributor

@Xavrax Xavrax commented Jul 29, 2024

feat: added filter and sort parameters to be closer to the other SDKs with object API.

added filter and sort parameters to be closer to the other SDKs with object API.

feat: configurable bool type.

configurable bool type.

fix: missing features needed for grant token API in CMakeLIsts.txt

missing features needed for grant token API in CMakeLIsts.txt

@Xavrax
Copy link
Contributor Author

Xavrax commented Jul 29, 2024

Additionally, added possibility to add suffix for pnsdk parameter

Copy link
Contributor

@parfeon parfeon left a comment

Choose a reason for hiding this comment

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

There are some questions. Maybe @KGronek share his idea.


// TODO: maybe it will be a good idea to add serialization at some point to this SDK
if (NULL != opts.data.custom) {
strcat(obj_buffer, "\"custom\":");
Copy link
Contributor

Choose a reason for hiding this comment

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

@Xavrax I know that this operation maybe not used that often, but strcat will traverse destination each time to find the right spot to append another string. Should we use snprintf here and in other places (I can patch)?

Comment on lines 48 to 53
set_opts.data.name = "\"my_name\"";
set_opts.data.external_id = "\"my_external_id\"";
set_opts.data.profile_url = "\"my_profile_url\"";
set_opts.data.email = "\"my_email\"";
set_opts.data.custom = "{\"key\":\"value\"}";
set_opts.include = "\"custom\"";
Copy link
Contributor

Choose a reason for hiding this comment

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

@Xavrax these lines actually look like another point to the snprintf usage (not that comfy as strcat) and the user will need to pass only actual values and snprintf will do the rest of the formatting. custom field yeah, special one, but the rest of them are plain strings.

core/pubnub_objects_api.h Outdated Show resolved Hide resolved
core/samples/pubnub_objects_api_sample.c Show resolved Hide resolved
refactor: update demo application

Remove some App Context configuration options JSON "stringify" (remove escaped double quotes).
@parfeon parfeon self-requested a review July 29, 2024 20:43
Copy link
Contributor

@parfeon parfeon left a comment

Choose a reason for hiding this comment

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

LGTM!

@parfeon
Copy link
Contributor

parfeon commented Jul 29, 2024

@pubnub-release-bot release

@parfeon parfeon merged commit 4789b71 into master Jul 30, 2024
6 checks passed
@parfeon parfeon deleted the feat/new-objects-vol2 branch July 30, 2024 05:37
@pubnub-release-bot
Copy link
Contributor

🚀 Release successfully completed 🚀

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.

3 participants