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

"Nothing type not JSON serializable" errors occurring when fetching list data from /seeds.json #5415

Closed
jimchamp opened this issue Jul 12, 2021 · 0 comments · Fixed by #6082
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]

Comments

@jimchamp
Copy link
Collaborator

When a list containing Infogami's Nothing type is fetched using /seeds.json, a TypeError is thrown because Nothing is not JSON serializable.

Evidence / Screenshot (if possible)

Relevant url?

https://openlibrary.org/people/tmanarl/lists/OL197952L/seeds.json?debug=true

Steps to Reproduce

  1. Navigate to the link listed above.
  • Actual: An error page is displayed.
  • Expected: A JSON-encoded list should be displayed

Details

  • Logged in (Y/N)? N/A
  • Browser type/version? N/A
  • Operating system? N/A
  • Environment (prod/dev/local)? prod

Proposal & Constraints

helpers.py contains a json_encode function that serializes Nothing types. This can be used instead of the vanilla JSON encoder.

Related files

Stakeholders

@libjenner

@jimchamp jimchamp added Type: Bug Something isn't working. [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] labels Jul 12, 2021
@jimchamp jimchamp changed the title Nothing type not JSON serializable errors occurring when fetching list data from /seeds.json "Nothing type not JSON serializable" errors occurring when fetching list data from /seeds.json Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Type: Bug Something isn't working. [managed]
Projects
None yet
1 participant