Skip to content

Interactive demo for jsonschema code examples #506

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

Closed
martinzugnoni opened this issue Dec 12, 2018 · 7 comments
Closed

Interactive demo for jsonschema code examples #506

martinzugnoni opened this issue Dec 12, 2018 · 7 comments
Labels
Enhancement Some new desired functionality

Comments

@martinzugnoni
Copy link
Contributor

Hello @Julian,

I've been using jsonschema for a while and I really like what you've built. We are also using it to teach our students at https://rmotr.com/ (co-founder and teacher here) to work with RESTful APIs.

While looking at the code examples in the README file I thought it would be great to provide some interactive demo that people can use to play with the library before committing to download and install it locally.

A demo is worth a thousand words 😉

I spent a few minutes compiling jsonschema examples into a Jupyter Notebook file, and adapted it in a way that we can open it with a small service we have at RMOTR to launch Jupyter environments online. No account or subscription required to use it, so it's pretty convenient for people that wants to get hands on the library with a low entrance barrier.

The result is what you can see in my fork of the repo (see the new "Demo" section):
https://github.com/martinzugnoni/jsonschema

Do you agree that having such interactive demo would help people to know and use jsonschema?
Let's use this issue as a kick off to start a discussion. Nothing here is written in stone and we can change everything as you wish.

I hope you like it, and I truly appreciate any feedback.

thanks.

@Julian
Copy link
Member

Julian commented Dec 15, 2018

Looks great! Thanks!

Will leave a few comments soon as I get a moment this week but overall definitely seems reasonable to add in.

Appreciated!

@martinzugnoni
Copy link
Contributor Author

thanks @Julian, absolutely!

No hurries at all. Let me know if there's something we should change. As I've mentioned above, this is just an initial version to start the discussion.

Appreciate your feedback.

@Julian Julian added this to the v3.1.0 milestone Jan 22, 2019
@martinzugnoni
Copy link
Contributor Author

@Julian did you have any time to take a look at Notebooks? If you confirm me I can move forward and create a PR with the required changes for the integration (shouldn't be much). Then we can iterate from there, either tuning the DEMO notebook or adding more code snippets. What do you think?

@Julian
Copy link
Member

Julian commented Feb 8, 2019

Hello! Apologies for the delay here... I did in fact take a quick look, and I had 2 main areas of concern pretty much --

First one is easy bikeshedding :), which is I just would like to slightly stylize the button a bit more so it fits within the text, as is it's a bit jarring / large :D

The second one is more important, which is that it worries me a bit to maintain the contents of the interactive demo as an ipynb -- it's very hard to review (changes) that way, even the current branch is hard to review without rendering the notebook essentially. I don't suppose you know whether there's a more data-driven way of defining the contents of cells? Say e.g. by defining a JSON file with the contents of each of the cells and then telling jupyter to use that? As is yeah, bit concerning maintainability-wise. But thoughts welcome!

@Julian
Copy link
Member

Julian commented Feb 8, 2019

(Another way by the way of maybe solving the first bikeshed there might be to instead use a clickable screen recording that leads you to the demo? But yeah something just looks off visually to me with the way the button is right now)

@Julian Julian added the Enhancement Some new desired functionality label Feb 16, 2019
@Julian Julian removed this from the v3.1.0 milestone Feb 25, 2019
@martinzugnoni
Copy link
Contributor Author

@Julian, it's my time now to apology for the delay response. Answering your concerns below:

  1. Button style must definitely change. This is just an example, and we should find something that we can smoothly integrate in the README.

  2. Sadly Github doesn't implement a Notebook diff (yet), but there are some libraries implemented for it, like https://nbdime.readthedocs.io/. I guess Github will integrate something like this in the UI soon, as Notebooks are becoming very popular. In the meantime, we can run the diff locally and review based on that.

If you confirm me I can move forward and create a PR and we can iterate from there.

@Julian
Copy link
Member

Julian commented Mar 1, 2019

:) no worries, life is life.

2. Sadly Github doesn't implement a Notebook diff (yet), but there are some libraries implemented for it, like https://nbdime.readthedocs.io/. I guess Github will integrate something like this in the UI soon, as Notebooks are becoming very popular. In the meantime, we can run the diff locally and review based on that

So I actually don't care much about GitHub to be honest, I don't use it to actually do anything really other than host the code and issue tracker, I review diffs in git outside of the website, it's just hard to review those changes as is because they embed things like ANSI color sequences in them, and a bunch of metadata... But yeah maybe that tool or another can get me the last mile there, it's not terrible, certainly not if it's an incremental change to the notebook I guess.

So yeah happy to see a PR!

@Julian Julian closed this as completed Mar 26, 2019
Julian added a commit that referenced this issue Oct 7, 2021
54440eab4 Merge pull request #516 from ChALkeR/chalker/ipv6
e7b22e1c6 Fix the sanity check by pinning.
8891d8107 Merge pull request #519 from json-schema-org/ether/custom-dialect
5f5fccda3 test the format-assertion vocabulary with a custom metaschema
3fcee3868 Merge pull request #512 from json-schema-org/ether/formats-and-non-strings
b349b8797 test that format-assertions are valid with non-string types
8e5b2f10d fix needless inconsistencies in format tests between drafts
02d7cb59a Correct "ref with sibling id" tests
1649470ba More ipv6 tests to increase coverage
7334b4c7e Merge pull request #505 from ChALkeR/chalker/fix-unicode
0fb2d2787 Consolidate optional/unicode into optional/ecmascript-regex
4f8c6d7bf unevaluatedProperties: deep dynamic + refs
9103f3b6f $ref wit id does not test what it is indented to do
f300dd15f Add test "same $anchor with different base uri"
d128f9d7f Add test to check that $id resolved against nearest parent, not just immediate parent
72e31dd20 Merge pull request #515 from json-schema-org/ether/fix-mandatory-format-tests
0173a0835 Revert "by default, "format" only annotates, not validates"
66e813a90 Merge pull request #506 from json-schema-org/ether/formats-non-ascii
9430972bc fix unicode tests in accordance to pattern/patternProperties spec

git-subtree-dir: json
git-subtree-split: 54440eab4d50b80a62cc9f9c561e306cdbb19591
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Some new desired functionality
Projects
None yet
Development

No branches or pull requests

2 participants