nbformat icon indicating copy to clipboard operation
nbformat copied to clipboard

Docs give incorrect JSON boolean values for code cells

Open tloredo opened this issue 6 years ago • 2 comments

In the docs on ReadTheDocs, here:

The Notebook file format — nbformat 4.5 documentation

there is an example code cell assigning values of True and False to boolean metadata. When I tried an example like this using Python 3's json module for parsing, it leads to a not-very-informative JSONDecodeError:

raise JSONDecodeError("Expecting value", s, err.value) from None

After isolating the problem to the boolean assignments, I found that changing to lower case true and false allows the parsing to complete without error. The JSON docs don't specifically say boolean values must be lower case, but the examples are lower case: JSON Data Types.

I think the docs should be fixed to address this; the relevant place appears to be: https://github.com/jupyter/nbformat/blob/master/docs/format_description.rst. I haven't checked for other occurrences of this problem.

tloredo avatar Mar 15 '18 07:03 tloredo

Good catch, thanks. It was probably written by someone thinking of Python rather than JSON. Do you want to make a PR to fix it?

takluyver avatar Mar 15 '18 15:03 takluyver

Sure, I'll fix whatever I find in format_description.rst. I posted it here first thinking docs experts might know if the issue appears elsewhere. I'm up to my gills this week, but should be able to handle it on the weekend.

tloredo avatar Mar 16 '18 02:03 tloredo