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

Support yyjson_mut_obj_add_obj & yyjson_mut_obj_add_arr like yyjson_mut_arr_add_* #140

Closed
CarterLi opened this issue Sep 12, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@CarterLi
Copy link
Contributor

CarterLi commented Sep 12, 2023

Is your feature request related to a problem? Please describe.

We do have yyjson_mut_arr_add_obj and yyjson_mut_arr_add_arr but not yyjson_mut_obj_add_obj and yyjson_mut_obj_add_arr, which seems strange.

Describe the solution you'd like

yyjson_api_inline yyjson_mut_val* yyjson_mut_obj_add_obj(yyjson_mut_doc *doc,
                                                          yyjson_mut_val *obj,
                                                          const char *_key) {
    yyjson_mut_val* newObj = yyjson_mut_obj(doc);
    yyjson_mut_obj_add_val(doc, obj, _key, newObj);
    return newObj;
}

yyjson_api_inline yyjson_mut_val* yyjson_mut_obj_add_arr(yyjson_mut_doc *doc,
                                                          yyjson_mut_val *obj,
                                                          const char *_key) {
    yyjson_mut_val* newArr = yyjson_mut_arr(doc);
    yyjson_mut_obj_add_val(doc, obj, _key, newArr);
    return newArr;
}

Describe alternatives you've considered

I add it manually to my repo, but I think it would be better if yyjson supports it natively

Additional context
Add any other context or screenshots about the feature request here.

@CarterLi CarterLi changed the title add yyjson_mut_obj_add_obj & yyjson_mut_obj_add_arr Support yyjson_mut_obj_add_obj & yyjson_mut_obj_add_arr like yyjson_mut_arr_add_* Sep 12, 2023
@ibireme ibireme added the enhancement New feature or request label Sep 12, 2023
@ibireme
Copy link
Owner

ibireme commented Sep 12, 2023

Thanks! The two missing functions have been added.

@ibireme ibireme closed this as completed Sep 12, 2023
@CarterLi
Copy link
Contributor Author

What about a new release?

@ibireme
Copy link
Owner

ibireme commented Sep 13, 2023

What about a new release?

It's released every six months and the next one should be in Dec.
Since there will be no major feature changes to this library, I want to keep the releases slow.

@CarterLi
Copy link
Contributor Author

CarterLi commented Sep 13, 2023

The problem is that fastfetch will release a new version soon, and it uses these two new functions.

I have updated the embed yyjson source in fastfetch source tree. However some package managers prefer system installed yyjson package. These two fns doesn't exist in 0.6.0 so that fastfetch build will fail. Even if I revert the upgrade-yyjson commit in fastfetch, once new version of yyjson is released, fastfetch build will fail because of the duplicated yyjson_mut_arr_add_* functions.

So that new version of fastfetch must be released after new version of yyjson. Any ideas?

@ibireme
Copy link
Owner

ibireme commented Sep 13, 2023

I see, in that case, let's go ahead and release a new version.

@ibireme
Copy link
Owner

ibireme commented Sep 13, 2023

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Oct 5, 2023
Needs >=0.8.0 for yyjson_mut_obj_add_obj.

Bug: ibireme/yyjson#140
Signed-off-by: Sam James <sam@gentoo.org>
flint2 pushed a commit to flint2/gentoo that referenced this issue Oct 6, 2023
Needs >=0.8.0 for yyjson_mut_obj_add_obj.

Bug: ibireme/yyjson#140
Signed-off-by: Sam James <sam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants