Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First example auto-generated JSON schemas. #261

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

kiniry
Copy link
Contributor

@kiniry kiniry commented Aug 13, 2017

The web server https://jsonschema.net/#/editor was used to process
captured JSON samples from Neal's smoketest work.

The web server https://jsonschema.net/#/editor was used to process
captured JSON samples from Neal's smoketest work.
@kiniry
Copy link
Contributor Author

kiniry commented Aug 13, 2017

How does this kind of thing look, @ranweiler?

Copy link
Contributor

@ranweiler ranweiler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kiniry, this is great, and will be extremely helpful. One question: did you mean to commit server_test-pp.json?

@dmzimmerman
Copy link
Member

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.

@ranweiler
Copy link
Contributor

I'd love it if we added such schemas for all endpoints, and merged this in.

@kiniry
Copy link
Contributor Author

kiniry commented Aug 18, 2017

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.

@kiniry kiniry self-assigned this Aug 18, 2017
@nealmcb
Copy link
Contributor

nealmcb commented Aug 31, 2017

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.

@dmzimmerman
Copy link
Member

Indeed. I would argue that we should actually rename that particular attribute, too.

@nealmcb
Copy link
Contributor

nealmcb commented Aug 31, 2017

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.

@nealmcb
Copy link
Contributor

nealmcb commented Oct 30, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants