clojure-spec

Chris 2022-11-24T08:59:08.726029Z

Is anyone aware of any projects that convert JSON-schema to specs? An internet search only turns up projects based on Java libs, but it would be preferable to have a spec created. (Most preferable would be to create the schema from a spec, but probably a much harder problem given the relative expressiveness!)

misha 2023-01-05T18:40:10.180339Z

@cbowdon https://github.com/akovantsev/json-schema-to-clojure-spec However it is pretty raw. Try it out!

Chris 2023-01-06T09:31:31.286549Z

Looks interesting, thanks!

tatut 2022-11-24T09:35:48.618199Z

I have some old code (not up to current json schema) https://github.com/tatut/json-schema you can use that as a predicate

tatut 2022-11-24T09:35:55.289459Z

but it doesn’t create clojure specs EDIT: nevermind, you wanted schema from specs

Chris 2022-11-24T10:19:15.545999Z

I wanted either 🙂 This is neat, thanks for sharing. Might be a good base for a ->spec version if I can’t find an existing implementation.

2022-11-24T17:03:42.450449Z

there is also spec-tools https://github.com/metosin/spec-tools/blob/master/docs/04_json_schema.md

Chris 2022-11-24T17:28:57.831659Z

Exactly what I wanted, thank you!