Open chrusty opened 3 years ago
Thanks for link! I was searching for a library which supports JSON Schema Draft 07
Upon further inspection it looks like this library https://github.com/santhosh-tekuri/jsonschema doesn't support conversion but rather just validation?
Hi @atreya2011. I've not done any testing against this library, but at first glance it did seem to support the new JSONSchema features that I'd like to use here.
protoc-gen-jsonschema wouldn't make use of any conversion capabilities anyway - these behaviours are so tighltly bound to the options we offer and the desired layouts. I'd really just be looking to use the structure and marshalling capabilities instead.
In any case, I've opened a PR with our existing dependency lib to introduce some of the stuff I want to use, so it might take the pressure off for a bit.
Thanks for your kind reply 🙏🏼 In then end I have decided to go down this path
A example of how I went about it is here if you are interested https://github.com/atreya2011/go-kratos-test/blob/32328056c8f2764b5f0fadeaf8e1d7a817b630d8/Makefile#L4
Hey @chrusty - https://github.com/pnwcode/protoc-gen-jsonschema/commit/86b60afd2c7d3db39b20125c5602650369d27a49 gets a compiling version of this. As the commit says, the tests are of course broken...but i needed schema 07 and this got me close enough.
Hey @parsnips, the invopop fork looks like the right choice - almost a drop-in replacement!
I can pick this up at some point, get it fully integrated and make sure the tests pass. Should we be concerned about any other schema-07 features that need to be brought along?
Should we be concerned about any other schema-07 features that need to be brought along?
I'm not sure, the thing I needed was the newer enumeration format and just by flipping versions it produced the correct json schema.
jsonschema by @alecthomas was discontinued. Maintenance has moved to invopop/jsonschema.
Are there still plans to update to a newer draft?
Following the publication of https://buf.build/community/chrusty-jsonschema, we received several questions and support requests for updated JSON Schema drafts.
We've started an initiative to publish a collection of Protobuf plugins, including jsonschema (Draft 2020-12), that generate various schemas from protobuf files.
Anyone interested can find the open-source repository here: bufbuild/protoschema-plugins and a protoc-gen-jsonschema
is also available as a Remote Plugin here.
We'll continue to publish @chrusty's plugin as new tags become available. ✌️
Currently we're using https://github.com/alecthomas/jsonschema to build JSONSchemas, but this project seems to have stopped at draft-04. It might be time to consider an alternative such as https://github.com/santhosh-tekuri/jsonschema,