Fixing a JSON‑Schema Break in the Content‑Automation Pipeline for Bluesky Posts
Fixing a JSON‑Schema Break in the Content‑Automation Pipeline for Bluesky Posts TL;DR: The automation stopped publishing to Bluesky because a stray comma broke the JSON schema used for post payloads. I updated the schema, patched the generation script, and added proper validation, getting the pipeline back online. The Problem My daily content‑automation repo ( content-automation ) generates…
The automation pipeline for publishing content to Bluesky encountered a break due to a stray comma in the JSON schema used for post payloads. This typo caused the JSON to become invalid, triggering a validation error from Ajv.validate which rejected the entire payload. The pipeline had been silently skipping the publish step, leaving Bluesky empty for the day.
To resolve the issue, a strict JSON schema was defined in schemas/bluesky-post.schema.json. This schema required each post object to contain only the properties 'type' and 'text', with 'type' being one of 'progress' or 'avance', and 'text' being a non-empty string. Additionally, additional properties were disallowed.
The generation script, scripts/generate-bluesky.js, was updated to use this schema for validation. A helper function was added to write JSON with deterministic formatting. A buildPayload function was implemented to create the payload based on the language specified. The script then iterated through the supported languages, built the payload, validated it against the schema using ajv.validate, and wrote the payload to the appropriate file if validation was successful.
By implementing a strict JSON schema and validating the generated payloads, the content-automation pipeline was restored to publishing correctly to Bluesky.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.