Live data from Hacker News

Ask HN: Is anyone using json schema?

news.ycombinator.com

11–18 of 18 posts

Re: Ask HN: Is anyone using json schema?

#12
post #5

Someone here tried it but we quickly gave up on it. - It's ugly and borderline impossible to write by hand because it's JSON. To document something complex your JSON objects get 20 layers deep and you don't get any decent commenting. - Because it's so hard to read, it's useless by itself as a guide to how the JSON should be structured. - Someone would change the code and always forget to update the schema to match. I…

> - Someone would change the code and always forget to update the schema to match. It only makes sense if you're somehow generating the code from the schema.

We used http://www.jsonschema2pojo.org/ (via the gradle plugin) on a previous project. I think it worked fairly well.

Re: Ask HN: Is anyone using json schema?

#14
A while back I wrote jsonmerge, a Python library for merging series of JSON documents. The syntax it uses for specifying merging rules is based on JSON schema:

https://pypi.python.org/pypi/jsonmerge

Blog post with some background:

https://www.tablix.org/~avian/blog/archives/2014/08/jsonmerg...

Re: Ask HN: Is anyone using json schema?

#16
We are using it at my current place of work with https://github.com/jdorn/json-editor to generate simple administrative UIs for backing configurations for non-technical users.

It's not a fantastic UX but it works and it's fast to develop.

The docs are sparse but for my money the format is relatively intuitive. I'd prefer to be using XML/XSL/XSLT as they are FAR more powerful, but that's just what you get with JSON.

Re: Ask HN: Is anyone using json schema?

#17
At a previous job (huge enterprise dev org of 1000+ devs, many many siloed teams) we used it for client-side validation of rest service calls.. it was a really easy way of detecting missing/bad data from upstream systems and handling it appropriately.

It was also great for contract testing in CI of other teams' services (warning us if they slipped some breaking change into the build).

Post reply on HN