Skip to content

add: ordered_json support, tests for the new functionality - #78

Open
Griger5 wants to merge 1 commit into
pybind:masterfrom
Griger5:master
Open

add: ordered_json support, tests for the new functionality#78
Griger5 wants to merge 1 commit into
pybind:masterfrom
Griger5:master

Conversation

@Griger5

@Griger5 Griger5 commented Aug 9, 2026

Copy link
Copy Markdown

Hello.

This PR enables support for nlohmann::ordered_json objects, thus it closes the 3 year old issue #63.

ordered_json implementation of the caster is included in a seperate header file to avoid unnecessary compilation for the end-user. However, with this approach there is a copy-paste problem, since the ordered implementation is virtually the exact same.

It can be abstracted with templates, you can check out how I did it in my fork of nanobind_json here: https://github.com/Griger5/nanobind_json/blob/main/include/nanobind_json/nanobind_json.h#L28
If you think the template version is better, please let me know.

A suite of seperate tests is also included, all of the regular json tests + two for checking the order.

Let me know if anything else needs addressing, hoping for a merge :)

@Griger5
Griger5 marked this pull request as ready for review August 9, 2026 16:29
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.

1 participant