First example auto-generated JSON schemas.
The web server https://jsonschema.net/#/editor was used to process captured JSON samples from Neal's smoketest work.
How does this kind of thing look, @ranweiler?
Those came out better than I would have expected. I like it, but I also think server_test-pp.json was probably an unintentional commit.
I'd love it if we added such schemas for all endpoints, and merged this in.
We'll have to complete this PR in the coming week or two via the ongoing work in the json-schemas branch, particularly using the idea embodied in 3cbadd3.
What is the best way to get useful comments into the schema?
E.g. we should document estimated_ballots_to_audit in the county_dashboard as estimated samples to audit since cvrs that are duplicated in the sample are counted as many times as they show up in the sample.
Indeed. I would argue that we should actually rename that particular attribute, too.
I'd support renaming it. Easy to change it in main.py. I was going to suggest that, but didn't know how much work would be involved.
After exploring this some more in the context of #845, Something more like genson (the powerful, user-friendly JSON Schema generator in Python: https://pypi.python.org/pypi/genson/ not Java genson) would seem more helpful. It makes it easier to document evolving schemas, since you can feed it as many schemas and objects as you want and it will spit out one, unified schema for them all. In particular I think we want to be able to manually edit descriptions of the elements, especially the ones that are complex and important to describe, but still update it all in an automatable way when a new element is added to a schema, etc.
I found several of the answers and comments at Tool to generate JSON schema from JSON data - Stack Overflow to be useful.