<?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: Pratibha Pujar</title>
    <description>The latest articles on DEV Community by Pratibha Pujar (@bhoomika).</description>
    <link>https://dev.to/bhoomika</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4249227%2F94654af9-3ab4-4640-a14f-831fdba7adf8.png</url>
      <title>DEV Community: Pratibha Pujar</title>
      <link>https://dev.to/bhoomika</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bhoomika"/>
    <language>en</language>
    <item>
      <title>How Do You Map API Dependencies Before Changing a Microservice?</title>
      <dc:creator>Pratibha Pujar</dc:creator>
      <pubDate>Tue, 17 Nov 2026 08:26:41 +0000</pubDate>
      <link>https://dev.to/bhoomika/how-do-you-map-api-dependencies-before-changing-a-microservice-eld</link>
      <guid>https://dev.to/bhoomika/how-do-you-map-api-dependencies-before-changing-a-microservice-eld</guid>
      <description>&lt;p&gt;Imagine your team changes an API response that looks harmless. The endpoint still works, its unit tests pass, and the service deploys successfully.&lt;/p&gt;

&lt;p&gt;A few minutes later, another service starts failing. Then a checkout workflow breaks. Eventually, someone discovers that three other APIs were relying on the response that just changed.&lt;/p&gt;

&lt;p&gt;The problem wasn't necessarily the code change. It was the lack of visibility into API dependencies.&lt;/p&gt;

&lt;p&gt;This is one of the challenges of working with microservices: understanding how a seemingly isolated API change affects the rest of the system.&lt;/p&gt;

&lt;p&gt;API dependency mapping helps solve this problem. It gives engineering teams a way to understand which APIs communicate with each other, which operations depend on particular response values, and what needs to be tested before a change reaches production.&lt;/p&gt;

&lt;p&gt;Let's look at how to build one and, more importantly, how to use it in your testing workflow.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What Is API Dependency Mapping?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;API dependency mapping is the process of identifying and documenting relationships between API operations.&lt;/p&gt;

&lt;p&gt;Think of it as a dependency graph where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each node represents an API operation.&lt;/li&gt;
&lt;li&gt;Each edge represents a relationship between two operations.&lt;/li&gt;
&lt;li&gt;Each relationship explains why one operation depends on another.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, consider a simple e-commerce application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /checkout
      |
      v
POST /orders
      |
      +------------------+
      |                  |
      v                  v
POST /inventory/reserve  POST /payments/charge
                              |
                              v
                     POST /notifications/receipt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This graph tells us more than a traditional architecture diagram.&lt;/p&gt;

&lt;p&gt;It shows which operations call each other and where a change might have downstream consequences.&lt;/p&gt;

&lt;p&gt;However, not all dependencies are identical. Understanding the difference is important.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understand the Four Types of API Relationships&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When mapping dependencies, I recommend separating relationships into four categories.&lt;/p&gt;

&lt;p&gt;A. Direct API calls&lt;/p&gt;

&lt;p&gt;One API invokes another while processing a request.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;POST /orders&lt;/code&gt; calls &lt;code&gt;POST /payments/charge&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If the payment API changes its request or response structure, the orders API may be affected.&lt;/p&gt;

&lt;p&gt;These relationships are particularly important for integration testing and mock planning.&lt;/p&gt;

&lt;p&gt;B. Data dependencies&lt;/p&gt;

&lt;p&gt;One API produces a value that another API consumes.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /customers
       |
       | Returns customer_id
       v
GET /customers/{customer_id}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second API depends on the identifier returned by the first.&lt;/p&gt;

&lt;p&gt;This relationship matters when designing test data, chaining API tests, and determining test execution order.&lt;/p&gt;

&lt;p&gt;C. Execution dependencies&lt;/p&gt;

&lt;p&gt;Sometimes one operation must happen before another, even when no response value is passed between them.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create account
      |
      v
Activate account
      |
      v
Generate account statement
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The order matters because the statement cannot be generated before the account is activated.&lt;/p&gt;

&lt;p&gt;D. Resource relationships&lt;/p&gt;

&lt;p&gt;Two endpoints may appear related because they operate on the same resource.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;GET /users&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;GET /users/{id}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, sharing a resource name does not automatically mean one endpoint depends on the other.&lt;/p&gt;

&lt;p&gt;This distinction matters. Treating every related endpoint as a dependency creates misleading graphs and unnecessarily expands regression test suites.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Where Should You Collect Dependency Information?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A dependency map is only as reliable as the evidence behind it.&lt;/p&gt;

&lt;p&gt;One common mistake is building the entire graph from endpoint names or assumptions.&lt;/p&gt;

&lt;p&gt;Instead, collect information from multiple sources.&lt;/p&gt;

&lt;p&gt;Workflow definitions and existing tests&lt;/p&gt;

&lt;p&gt;Existing test chains can reveal which API calls produce values consumed by subsequent calls.&lt;/p&gt;

&lt;p&gt;Distributed traces&lt;/p&gt;

&lt;p&gt;Tracing tools can show actual service-to-service communication and help identify dependencies that aren't documented.&lt;/p&gt;

&lt;p&gt;API gateways&lt;/p&gt;

&lt;p&gt;Gateway configurations can reveal upstream routes and service relationships.&lt;/p&gt;

&lt;p&gt;Captured traffic&lt;/p&gt;

&lt;p&gt;Request logs, HAR files, and captured sessions can help reconstruct API interactions.&lt;/p&gt;

&lt;p&gt;Developer and service-owner knowledge&lt;/p&gt;

&lt;p&gt;Some dependencies won't appear in HTTP traces. Scheduled jobs, event-driven integrations, and internal tools may require information from the teams maintaining them.&lt;/p&gt;

&lt;p&gt;An important practice is to record how each relationship was discovered.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dependency&lt;/th&gt;
&lt;th&gt;Evidence&lt;/th&gt;
&lt;th&gt;Confidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Orders → Payments&lt;/td&gt;
&lt;td&gt;Distributed trace&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customers → Orders&lt;/td&gt;
&lt;td&gt;Existing test workflow&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Orders → Notifications&lt;/td&gt;
&lt;td&gt;Service owner confirmation&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Users → Profiles&lt;/td&gt;
&lt;td&gt;Endpoint naming similarity&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Don't treat an inferred relationship as a confirmed dependency.&lt;/p&gt;

&lt;p&gt;Keeping evidence visible makes the map more trustworthy.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How to Build an API Dependency Map Step by Step&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You don't need to map an entire microservices architecture immediately.&lt;/p&gt;

&lt;p&gt;Start with one important business workflow.&lt;/p&gt;

&lt;p&gt;For example, choose an order checkout journey.&lt;/p&gt;

&lt;p&gt;Step 1: Identify the critical workflow&lt;/p&gt;

&lt;p&gt;List the API operations involved in completing the workflow.&lt;/p&gt;

&lt;p&gt;Start with the entry point and follow the requests until the operation is complete.&lt;/p&gt;

&lt;p&gt;Step 2: Collect declared dependencies&lt;/p&gt;

&lt;p&gt;Look at existing API specifications, workflow definitions, integration tests, and service documentation.&lt;/p&gt;

&lt;p&gt;These sources reveal relationships that developers already know about.&lt;/p&gt;

&lt;p&gt;Step 3: Add observed dependencies&lt;/p&gt;

&lt;p&gt;Use distributed traces, gateway routes, and captured traffic to discover actual communication patterns.&lt;/p&gt;

&lt;p&gt;This is where you may find dependencies that nobody documented.&lt;/p&gt;

&lt;p&gt;Step 4: Include dependencies that require human input&lt;/p&gt;

&lt;p&gt;Add event-driven relationships, scheduled jobs, and other connections that aren't visible through request tracing.&lt;/p&gt;

&lt;p&gt;Record who confirmed each relationship.&lt;/p&gt;

&lt;p&gt;Step 5: Label every relationship&lt;/p&gt;

&lt;p&gt;Record the relationship type, evidence source, environment, and last-observed date.&lt;/p&gt;

&lt;p&gt;This helps distinguish current dependencies from outdated information.&lt;/p&gt;

&lt;p&gt;Step 6: Review inferred relationships&lt;/p&gt;

&lt;p&gt;Keep suggestions based on endpoint names or other indirect evidence separate until someone verifies them.&lt;/p&gt;

&lt;p&gt;A dependency map should represent what you know, not everything you suspect.&lt;/p&gt;

&lt;p&gt;5.How to Calculate the Blast Radius of an API Change&lt;/p&gt;

&lt;p&gt;This is where dependency mapping becomes particularly useful.&lt;/p&gt;

&lt;p&gt;Let's return to our e-commerce example.&lt;/p&gt;

&lt;p&gt;Suppose the inventory team wants to change the response of:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;POST /inventory/reserve&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Before making the change, the team needs to understand which operations might be affected.&lt;/p&gt;

&lt;p&gt;Consider these relationships:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /checkout
       |
       v
POST /orders
       |
       +----------------------+
       |                      |
       v                      v
POST /inventory/reserve   POST /payments/charge
       |
       |
       +----&amp;gt; Change planned
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;POST /inventory/reserve&lt;/code&gt; changes, the team should investigate its upstream consumers.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hop&lt;/th&gt;
&lt;th&gt;API&lt;/th&gt;
&lt;th&gt;Reason&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;POST /inventory/reserve&lt;/td&gt;
&lt;td&gt;API being changed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;POST /orders&lt;/td&gt;
&lt;td&gt;Calls inventory API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;POST /checkout&lt;/td&gt;
&lt;td&gt;Calls orders API&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;There may also be data dependencies. If &lt;code&gt;POST /orders&lt;/code&gt; produces an order ID consumed by &lt;code&gt;GET /orders/{id}&lt;/code&gt;, that read operation should be considered separately.&lt;/p&gt;

&lt;p&gt;Notice that the blast radius follows actual calls and data dependencies, not simply execution order.&lt;/p&gt;

&lt;p&gt;I would also avoid following every relationship indefinitely. A practical starting point is to investigate one- to four-hop dependencies, then expand when the evidence suggests a wider impact.&lt;/p&gt;

&lt;p&gt;The goal isn't to produce the largest possible graph. It's to identify the tests and teams that genuinely need attention.&lt;/p&gt;

&lt;p&gt;6.How Does Dependency Mapping Improve API Testing?&lt;/p&gt;

&lt;p&gt;A dependency map becomes much more valuable when you connect it to your testing strategy.&lt;/p&gt;

&lt;p&gt;Here are five practical applications.&lt;/p&gt;

&lt;p&gt;Select regression tests intelligently&lt;/p&gt;

&lt;p&gt;When an API changes, you don't always need to execute every test in your entire system.&lt;/p&gt;

&lt;p&gt;Start with tests covering the changed operation and its affected neighbours.&lt;/p&gt;

&lt;p&gt;If those tests identify additional problems, expand the regression scope.&lt;/p&gt;

&lt;p&gt;Improve test execution order&lt;/p&gt;

&lt;p&gt;When one API creates data that another API consumes, the dependency map helps establish the correct execution sequence.&lt;/p&gt;

&lt;p&gt;Setup operations run first, dependent tests follow, and cleanup happens last.&lt;/p&gt;

&lt;p&gt;Plan API mocks&lt;/p&gt;

&lt;p&gt;Suppose you want to test the orders API independently.&lt;/p&gt;

&lt;p&gt;You need to simulate the inventory and payment APIs it calls.&lt;/p&gt;

&lt;p&gt;A dependency map provides a clear list of those external interactions, helping you build mocks that represent the actual integration boundaries.&lt;/p&gt;

&lt;p&gt;Identify missing contract tests&lt;/p&gt;

&lt;p&gt;If two services communicate but have no contract validation between them, that relationship deserves attention.&lt;/p&gt;

&lt;p&gt;You can prioritize contract tests based on the dependencies that create the greatest risk.&lt;/p&gt;

&lt;p&gt;Improve incident investigation&lt;/p&gt;

&lt;p&gt;When an API starts failing, the map helps identify downstream services that might be experiencing secondary failures.&lt;/p&gt;

&lt;p&gt;Instead of investigating every failing service independently, engineers can trace the likely source of the problem.&lt;/p&gt;

&lt;p&gt;7.Common API Dependency Mapping Mistakes&lt;/p&gt;

&lt;p&gt;Even a well-designed dependency map can become unreliable.&lt;/p&gt;

&lt;p&gt;Watch out for these mistakes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mapping services instead of operations: Knowing that Orders depends on Payments isn't enough. Identify the actual endpoints involved.&lt;/li&gt;
&lt;li&gt;Creating the map once: Dependencies change as applications evolve. Maps need regular updates.&lt;/li&gt;
&lt;li&gt;Treating guesses as facts: Label inferred relationships and get them verified.&lt;/li&gt;
&lt;li&gt;Ignoring environments: A dependency observed in staging doesn't automatically prove the same relationship exists in production.&lt;/li&gt;
&lt;li&gt;Ignoring asynchronous communication: Events, queues, and scheduled jobs create dependencies that ordinary HTTP tracing might miss.&lt;/li&gt;
&lt;li&gt;Overestimating the blast radius: Not every related endpoint is a genuine dependency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The biggest lesson is that dependency mapping should be an ongoing engineering practice, not a diagram created for documentation and forgotten afterward.&lt;/p&gt;

&lt;p&gt;8.Bringing Dependency Mapping Into Your API Testing Workflow&lt;/p&gt;

&lt;p&gt;Maintaining dependency information manually becomes difficult as the number of services and API operations grows.&lt;/p&gt;

&lt;p&gt;This is where API testing platforms and automated discovery workflows can help.&lt;/p&gt;

&lt;p&gt;For example, Shift-Left API by Total Shift Left provides dependency visibility at the API level, including relationships such as which APIs call other APIs, which use their values, and which operations run before others.&lt;/p&gt;

&lt;p&gt;It also separates the relationship itself from the evidence behind it, helping teams understand how a dependency was identified.&lt;/p&gt;

&lt;p&gt;The broader principle is worth considering regardless of the tools you use: dependency information should be connected to API testing, change impact analysis, and regression planning rather than living in a separate architecture document.&lt;/p&gt;

&lt;p&gt;For a deeper explanation of the dependency types, evidence sources, worked examples, and implementation approach, see this [&lt;a href="https://totalshiftleft.ai/blog/api-dependency-mapping-guide" rel="noopener noreferrer"&gt;API dependency mapping guide&lt;/a&gt;].&lt;/p&gt;

&lt;p&gt;Final Thoughts&lt;/p&gt;

&lt;p&gt;Microservices give engineering teams flexibility, but that flexibility comes with a cost: understanding how independently developed services affect one another.&lt;/p&gt;

&lt;p&gt;An API change that looks small in isolation can have consequences across several downstream operations.&lt;/p&gt;

&lt;p&gt;API dependency mapping helps make those relationships visible.&lt;/p&gt;

&lt;p&gt;Start with one critical workflow. Identify the operations involved, collect evidence from existing tests and runtime traces, distinguish confirmed relationships from assumptions, and use the resulting map to guide regression testing.&lt;/p&gt;

&lt;p&gt;You don't need a perfect dependency graph on day one.&lt;/p&gt;

&lt;p&gt;You need a reliable enough map to answer one important question before every significant API change:&lt;/p&gt;

&lt;p&gt;What could break if we change this endpoint, and how will we know before it reaches production?&lt;/p&gt;

&lt;p&gt;That's where dependency mapping becomes a practical part of building reliable microservices.&lt;/p&gt;

</description>
      <category>api</category>
      <category>architecture</category>
      <category>microservices</category>
      <category>systemdesign</category>
    </item>
  </channel>
</rss>
