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

[Json] - Fix enum string read for vector of pairs in concatenate mode #1525

Conversation

sjanel
Copy link
Collaborator

@sjanel sjanel commented Dec 26, 2024

This PR fixes an expected_quote parsing error occurring for objects of type vector<std::pair<MyEnum, ...> when in concatenate mode and if user requests parsing of enums as strings.

This PR takes the assumption that

std::is_enum_v<typename V::first_type> && detail::glaze_t<typename V::first_type>

is true if and only if the enum needs to be serialized / de-serialized as strings instead of values (based on my findings). Please help me correct the code if this assumption is wrong.

Updated the unit tests accordingly.

@sjanel sjanel added the bug Something isn't working label Dec 26, 2024
@sjanel sjanel requested a review from stephenberry December 26, 2024 19:32
@stephenberry
Copy link
Owner

Thanks for this pull request! I'll try to look it over soon.

@sjanel sjanel force-pushed the bugfix/fix-json-read-enum-string-vector-pair-concatenate branch from 3411579 to 0cc21a1 Compare December 26, 2024 19:41
@stephenberry
Copy link
Owner

I think this makes sense, it allows for quoted enum parsing in vectors of pairs. I'll merge it in. Thanks!

@stephenberry stephenberry merged commit c00883e into stephenberry:main Dec 26, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants