json icon indicating copy to clipboard operation
json copied to clipboard

Feature request - Validate JSON against JSON Schema

Open moravas opened this issue 3 years ago • 16 comments

Hi,

In our Linux based C++ project we are using Boost JSON parsing library but I would like to validate the JSON document against JSON Schema.

I don't see any support for schema validation in Boost JSON.

Did I missed something, or is there any plan to add this feature to Boost?

Thank you

moravas avatar Jan 17 '23 06:01 moravas

There's no JSON Schema support currently, and there's no current work to add it. But we often get asked about it, so this might change.

grisumbras avatar Jan 17 '23 06:01 grisumbras

It would be a very welcomed feature. How can the community encourage you to raise the priority of this feature?

Thank you!

moravas avatar Jan 28 '23 08:01 moravas

Just commenting in this issue would be enough

grisumbras avatar Jan 28 '23 12:01 grisumbras

Also would like this feature, maybe I might be able to contribute.

Superlokkus avatar Apr 25 '23 08:04 Superlokkus

How can the community encourage you to raise the priority of this feature

Well, you could write it, and submit a pull request...

vinniefalco avatar Apr 25 '23 10:04 vinniefalco

Hi, Any news regarding this schema validator feature?

Thank you

moravas avatar Jul 13 '23 03:07 moravas

Nothing new yet.

grisumbras avatar Jul 17 '23 14:07 grisumbras

Hi moravas, I am currently reading into the boost JSON internals and the JSON Schema Draft but, as this is my first would be boost contrib. this will take a long while.

Superlokkus avatar Jul 17 '23 17:07 Superlokkus

Is there enough interest in this to propose it as a GSOC '24 project? I know we'd use JSON Schema validation in C++, if it was available via boost. They're calling for mentors on the boost mailing list at the moment.

nigels-com avatar May 05 '24 23:05 nigels-com

Depends on whether @vinniefalco considers this to be in scope.

I initially thought that schema validation could be great in the example section. But I don't know if the implementation would be small enough to work as an example. I guess, if it is appropriate for a GSoC project, it's not so small.

By the way, are there any other features related to JSON Schema, or is it only validation?

grisumbras avatar May 06 '24 06:05 grisumbras

Indeed. I don't really have a sense if such a thing should be part of boost::json, or an optional layer on top of it.

nigels-com avatar May 06 '24 08:05 nigels-com

There is no rule that says examples can't be large.

vinniefalco avatar May 06 '24 16:05 vinniefalco

The utility of an example greatly diminishes, if the implementation is too large to easily grok

grisumbras avatar May 06 '24 16:05 grisumbras

But that is false. The main use-case for examples is as follows: someone makes a copy of the code and incorporates it into their own program, or they use it as the beginning of a new program. For this purpose a large example is as good as any other.

vinniefalco avatar May 06 '24 17:05 vinniefalco

Hi there,

any progress? It would be a great feature in our product, where we process many JSON format text that in first step should fit into particular schema.

I don't know other schema related feature right now

moravas avatar Jun 02 '24 06:06 moravas

No work has been done on this front so far.

grisumbras avatar Jun 02 '24 13:06 grisumbras