Skip to content

feat(json): add reusable SerializeOptions for dumps and dump_file - #1

Open
ayushactiveat wants to merge 1 commit into
vixcpp:mainfrom
ayushactiveat:feat/serialize-options
Open

ayushactiveat wants to merge 1 commit into
vixcpp:mainfrom
ayushactiveat:feat/serialize-options

Conversation

@ayushactiveat

Copy link
Copy Markdown

Closes vixcpp/vix#543.

adds SerializeOptions { pretty, indent, ensure_ascii } and overloads
of dumps() and dump_file() (fs::path, const char*, std::string).

previous positional overloads are unchanged, ie, indent < 0 =
compact.

indent < 0 throws std::invalid_argument.

new test file json_dumps_options_test.cpp covers compact/pretty/
custom indent / ensure_ascii / invalid options / dump_file-with-options,
plus compat checks that positional overloads still work.

tested locally

@ayushactiveat

Copy link
Copy Markdown
Author

@GaspardKirira let me know if any changes are needed

@GaspardKirira

Copy link
Copy Markdown
Member

Okay, thanks

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.

feat(json): add reusable JSON serialization options

2 participants