pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

fix: check the json switcher file

Open 12rambau opened this issue 3 years ago • 1 comments

When adding a json switcher using an url I added a few test on the file itself to make sure it's not malformed in order to help developer track down bugs.

Fix #901

12rambau avatar Sep 06 '22 11:09 12rambau

sorry for the noise, some of the errors where only occuring in the github build.

Some explanations:

  • checking if there is a json-url key
  • check that there is a version key
  • find the file using request if the file is distant and read it from the source folder if it's a local one
  • check the content of the switcher file and make sure that all elements have a "url" and "version" key
  • if anything goes wrong raise an error

12rambau avatar Sep 27 '22 17:09 12rambau