json icon indicating copy to clipboard operation
json copied to clipboard

Natvis file for version 3.12.0 does not contain a type definition for detail::json_default_base

Open sakuntalle opened this issue 2 months ago • 5 comments

Description

With version 3.12.0 the underlying type for a nlohmann::json is nlohmann::json_abi_diag_v3_12_0::detail::json_default_base and this type does not have a Type definition in the corresponding natvis template and generated natvis file.

Reproduction steps

Add the natvis file to your project and try to introspect a nlohmann::json object

Expected vs. actual results

Introspection based on natvis file is not used.

Minimal code example


Error messages


Compiler and operating system

Windows 11, Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.14.19

Library version

3.12.0

Validation

sakuntalle avatar Oct 29 '25 16:10 sakuntalle

I can submit a PR that adds <Type Name="{{ ns }}::detail::json_default_base"> in the nlohmann_json.natvis.j2 file

sakuntalle avatar Oct 29 '25 16:10 sakuntalle

Please do! Thanks for submitting!

nlohmann avatar Oct 29 '25 17:10 nlohmann

Why do you need a natvis entry for an empty class?

gregmarr avatar Oct 30 '25 18:10 gregmarr

Why do you need a natvis entry for an empty class?

Please see my detailed explanation from the PR comment on this

sakuntalle avatar Oct 31 '25 08:10 sakuntalle

Looking at https://github.com/nlohmann/json/pull/4973, I get the feeling the problem is not fully understood, and the change just happen to make the problem disappear. It would be great to know for certain what needs to be done.

nlohmann avatar Oct 31 '25 09:10 nlohmann