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

Adjust JSON Pointer examples #3622

Merged
merged 6 commits into from
Jul 29, 2022
Merged

Conversation

nlohmann
Copy link
Owner

@nlohmann nlohmann commented Jul 28, 2022

Fix documentation issue after #3600.

Also add test to check the examples' outputs to the CI.

Copy link
Contributor

@falbrechtskirchinger falbrechtskirchinger left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@nlohmann
Copy link
Owner Author

File patch_inplace.output has an issue with a missing newline. Let's see if the CI detects this.

@falbrechtskirchinger
Copy link
Contributor

There's one more issue with multimap I found while regenerating the outputs on my machine. I don't remember which example ...

@coveralls
Copy link

coveralls commented Jul 29, 2022

Coverage Status

Coverage remained the same at 100.0% when pulling 9227b3d on fix_quotes_in_json_pointer_examples into e3095f6 on develop.

@falbrechtskirchinger
Copy link
Contributor

Please replace make with $(MAKE) in docs/Makefile. Should get rid of those "jobserver unavailable" warnings.

@falbrechtskirchinger
Copy link
Contributor

Example basic_json__CompatibleType.cpp differs in line 5 (on my machine).

{"one":true,"three":false,"two":true}

{"one":true,"three":true,"two":true}

The others are patch_inplace.cpp (as you mentioned), max_size.cpp, and std_hash.cpp.

@nlohmann
Copy link
Owner Author

Example basic_json__CompatibleType.cpp differs in line 5 (on my machine).

{"one":true,"three":false,"two":true}

{"one":true,"three":true,"two":true}

That is odd. I cannot find a hint in the documentation of std::unordered_multimap that the constructor's behavior is platform-dependent. Maybe I'll use emplace to avoid this.

The others are patch_inplace.cpp (as you mentioned), max_size.cpp, and std_hash.cpp.

Oh, I totally forgot about those. I will also add notes to the API pages using these examples that the output is platform-dependent.

@falbrechtskirchinger
Copy link
Contributor

Example basic_json__CompatibleType.cpp differs in line 5 (on my machine).

{"one":true,"three":false,"two":true}

{"one":true,"three":true,"two":true}

That is odd. I cannot find a hint in the documentation of std::unordered_multimap that the constructor's behavior is platform-dependent. Maybe I'll use emplace to avoid this.

Isn't that about which of multiple objects matching the same key is returned? I'd assume the standard doesn't require anything specific.

@nlohmann
Copy link
Owner Author

You're right - I forgot that (of course) the container stores multiple values and only the conversion to JSON drops all but one. Alright, I'll add it to the list of platform-dependent examples and then we should be fine.

@nlohmann nlohmann self-assigned this Jul 29, 2022
@nlohmann nlohmann added this to the Release 3.11.0 milestone Jul 29, 2022
@nlohmann nlohmann merged commit d1d79b9 into develop Jul 29, 2022
@nlohmann nlohmann deleted the fix_quotes_in_json_pointer_examples branch July 29, 2022 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants