json schema validator

Created on 6 Sep 2016  路  14Comments  路  Source: nlohmann/json

Is there any plan to extend the project to support json schema for validating serialization/ serialization ?.

enhancemenimprovement question

Most helpful comment

I continue. The design approach is different (completely based on your json-lib and nothing else).

And it's fun.

All 14 comments

JSON Schema is quite complicated, and it would not make sense to include validation into a header-only library. However, doing this in a different project surely would make sense. Unfortunately, I do not have time for this right now.

@pboettch Have you looked at https://github.com/tristanpenman/valijson which is a header-only C++ library which was tested to work with v1.1.0 of this library?

I saw it when doing my research, then forgot about it and was disappointed by the validator of rapidjson. Stupid me - it looks good. But I learnt how to use nlohmann::json and I learnt about schemas. Was worth the time spent.

That kind of experience with something you weren't well versed in before is always helpful. :)

@pboettch So what is the state of your project now? Will you continue or are you happy with tristanpenman/valijson?

I continue. The design approach is different (completely based on your json-lib and nothing else).

And it's fun.

JSON Schema is quite complicated, and it would not make sense to include validation into a header-only library. However, doing this in a different project surely would make sense. Unfortunately, I do not have time for this right now.

Sorry for noise, but I can't see why the validation can not be a header only lib?

Which one? valijson is header only. Mine's not. Mine seems to be faster. Compilation and runtime.

I've just seen yours, I like the idea of nlohmann lib "addon"
And have you test a header only version of your implementation ;)

No, but you can try it yourself. Just include the .cpp-file in your code.

You will lose on compile-time, gain nothing on runtime but it might be easier to integrate if you don't want to use CMake.

ok I'll give a try
in a header only form it could be integrated in this lib

thx for your lib, seems very promising

Hammering everything to header-only because project-policies is not helping anyone. At least in my opinion.

Oh ok, I don't have enough experience to have a good opinion
But, I think it could be useful to have an header version and a binary version :D

Was this page helpful?
0 / 5 - 0 ratings