Describe the bug
jsonschema::make_json_schema seemingly accepts any Json type, but fails to compile with a wjson at a random location in the code:
C:\Users\Ron\Code\jsoncons\include\jsoncons_ext\jsonschema\json_schema_factory.hpp(43): error C2665: 'jsoncons::basic_json<wchar_t,jsoncons::sorted_policy,std::allocator<char>>::find': no overloaded function could convert all the argument types
The error is at this line:
|
auto it = root_schema->find("$schema"); |
Replacing "$schema" with JSONCONS_CSTRING_CONSTANT(Json::char_type, "$schema") works, but there are many other places where adjustments need to be made in order for the code to be CharT-agnostic. Fixing that line makes compilation fail elsewhere.
I would expect either full support for all Json types, or an explicit enable_if for json/ojson only.
Enumerate the steps to reproduce the bug
Try to create a json_schema<wjson> object.
Include a small, self-contained example if possible
using jsoncons::wjson;
namespace jsonschema = jsoncons::jsonschema;
wjson schema = wjson::parse(LR"(
{
"properties": {
"foo": {
"type": "string"
}
}
}
)");
jsonschema::json_schema<wjson> compiled = jsonschema::make_json_schema(schema);
What compiler, architecture, and operating system?
- Compiler: MSVC
- Architecture (e.g. x86, x64) x64
- Operating system: Windows
What jsoncons library version?
Describe the bug
jsonschema::make_json_schemaseemingly accepts anyJsontype, but fails to compile with awjsonat a random location in the code:The error is at this line:
jsoncons/include/jsoncons_ext/jsonschema/json_schema_factory.hpp
Line 43 in 01218c7
Replacing
"$schema"withJSONCONS_CSTRING_CONSTANT(Json::char_type, "$schema")works, but there are many other places where adjustments need to be made in order for the code to beCharT-agnostic. Fixing that line makes compilation fail elsewhere.I would expect either full support for all
Jsontypes, or an explicitenable_ifforjson/ojsononly.Enumerate the steps to reproduce the bug
Try to create a
json_schema<wjson>object.Include a small, self-contained example if possible
What compiler, architecture, and operating system?
What jsoncons library version?