Validating my JSON Feed on every site build
Earlier today, I found that my site's JSON feed has been broken since Thursday afternoon. I like to ensure that my site has a pretty high uptime of functionality, so this kinda sucked.
This isn't as much of an issue because I don't believe many folks use my JSON feed, as I have a fully fledged h-feed and RSS feed, and JSON feed isn't as popular.
However, as mentioned in Re-enabling search on my static website, this JSON feed is actually to be used for my search functionality on the site. This is more of a problem because it leaves the site broken, and folks aren't able to find previous content on the site.
Since September I've had an issue to check whether the feed was valid JSON in my build pipeline, but I haven't yet actually done it because I didn't think it could be that bad, and it didn't break that often.
I have, now, resolved the issue by fixing the issue that caused it to break, adding a validation step to ensure the feed is well-formed and I've also added follow-up work to stop this specific issue happening again.
Going through and validating that it is a valid JSON Feed, rather than just checking it's valid JSON, has actually picked up on the fact that my JSON feed has never been correct, as it has retuned an invalid field
At least I'm moving slowly towards a well-formed site, and regression-proofing these issues by automating the steps to catch breakages in the future!