<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CemCelik</title>
    <description>The latest articles on DEV Community by CemCelik (@cemcelik79).</description>
    <link>https://dev.to/cemcelik79</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3929960%2F1a0c54d7-e3d6-46f5-9f37-34ca9aaeb948.jpeg</url>
      <title>DEV Community: CemCelik</title>
      <link>https://dev.to/cemcelik79</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cemcelik79"/>
    <language>en</language>
    <item>
      <title>How I Built SchemaWatch: A CLI Tool That Catches Breaking API Changes Before Production</title>
      <dc:creator>CemCelik</dc:creator>
      <pubDate>Wed, 13 May 2026 19:16:43 +0000</pubDate>
      <link>https://dev.to/cemcelik79/how-i-built-schemawatch-a-cli-tool-that-catches-breaking-api-changes-before-production-4539</link>
      <guid>https://dev.to/cemcelik79/how-i-built-schemawatch-a-cli-tool-that-catches-breaking-api-changes-before-production-4539</guid>
      <description>&lt;h2&gt;
  
  
  The Problem I Kept Running Into
&lt;/h2&gt;

&lt;p&gt;It was a regular sprint. Backend team updated the API. Frontend team wasn't notified. The field &lt;code&gt;user.id&lt;/code&gt; changed from &lt;code&gt;integer&lt;/code&gt; to &lt;code&gt;string&lt;/code&gt;. Nobody caught it in code review.&lt;/p&gt;

&lt;p&gt;Production broke at 3AM.&lt;/p&gt;

&lt;p&gt;Sound familiar?&lt;/p&gt;

&lt;p&gt;I kept running into this exact problem — not because anyone was careless, but because there was &lt;strong&gt;no simple, automated way to catch breaking API changes before they shipped&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Existing tools like &lt;code&gt;oasdiff&lt;/code&gt; are powerful, but they felt heavy for what I needed. I just wanted one command that would tell me: &lt;em&gt;"Hey, this change will break your clients."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;SchemaWatch&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What SchemaWatch Does
&lt;/h2&gt;

&lt;p&gt;SchemaWatch compares two OpenAPI schema files and detects breaking changes — classified by severity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;schemawatch
python &lt;span class="nt"&gt;-m&lt;/span&gt; schemawatch.cli old.yaml new.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. No config files. No setup. Just two YAML files and one command.&lt;/p&gt;

&lt;p&gt;The output looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;====================================
🚨 SchemaWatch Report
====================================

Breaking changes detected: 5

── CRITICAL (2)
🔴 Endpoint removed: /orders
🔴 Method removed: GET /users

── WARNING (3)
🟡 Response field removed: User.email
🟡 Field type changed: User.id integer -&amp;gt; string
🟡 Field became required: User.id

------------------------------------
Summary:
- Total changes: 5
- Critical: 2
- Warning:  3
- Info:     0
------------------------------------
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Severity Levels Matter
&lt;/h2&gt;

&lt;p&gt;One thing I noticed with other tools: &lt;strong&gt;they treat all changes equally&lt;/strong&gt;. But a removed description field is not the same as a removed endpoint.&lt;/p&gt;

&lt;p&gt;SchemaWatch classifies changes into three levels:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;🔴 &lt;strong&gt;Critical&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Endpoint removed, HTTP method removed, schema removed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🟡 &lt;strong&gt;Warning&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Field removed, type changed, field became required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;🔵 &lt;strong&gt;Info&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Enum changed, array item type changed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In a CI/CD pipeline, this means you can decide: &lt;em&gt;"Fail the build only on Critical changes, warn on everything else."&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  CI/CD Integration
&lt;/h2&gt;

&lt;p&gt;SchemaWatch is designed to live inside your pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# .github/workflows/schemawatch.yml&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check for breaking API changes&lt;/span&gt;
  &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python -m schemawatch.cli openapi_old.yaml openapi.yaml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Exit code &lt;code&gt;1&lt;/code&gt; → breaking changes detected ❌ — build fails&lt;/li&gt;
&lt;li&gt;Exit code &lt;code&gt;0&lt;/code&gt; → no breaking changes ✅ — build passes&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The core logic is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Parser&lt;/strong&gt; — load and validate both YAML files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diff Engine&lt;/strong&gt; — compare paths, methods, schemas, fields recursively&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Severity Classifier&lt;/strong&gt; — tag each change as critical/warning/info&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CLI&lt;/strong&gt; — format and display output (text, JSON, or Markdown)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The trickiest part was &lt;strong&gt;recursive nested object comparison&lt;/strong&gt;. OpenAPI schemas can have deeply nested &lt;code&gt;properties&lt;/code&gt;, and a type change three levels deep is just as breaking as one at the top level.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;compare_properties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;old_props&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_props&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;old_fields&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;new_fields&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Recursive check for nested objects
&lt;/span&gt;        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;old_field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;object&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;new_field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;object&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;changes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="nf"&gt;compare_properties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;old_nested&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_nested&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;SchemaWatch is actively developed. On the roadmap:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Request body change detection&lt;/li&gt;
&lt;li&gt;[ ] Response status code comparison&lt;/li&gt;
&lt;li&gt;[ ] Custom GitHub Action (Marketplace)&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;.schemawatch-ignore&lt;/code&gt; file for intentional breaking changes&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;schemawatch
python &lt;span class="nt"&gt;-m&lt;/span&gt; schemawatch.cli old.yaml new.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/CemCelik79/schemawatch" rel="noopener noreferrer"&gt;https://github.com/CemCelik79/schemawatch&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you've ever been burned by an undocumented API change, give it a try. And if you have feedback — especially on what breaking change patterns SchemaWatch doesn't catch yet — I'd love to hear it in the comments.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with Python, colorama, and a lot of 3AM production incidents as motivation.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
