<?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: Mockzilla</title>
    <description>The latest articles on DEV Community by Mockzilla (@mockzilla).</description>
    <link>https://dev.to/mockzilla</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%2F3961128%2F90f295bd-c6e5-417d-b1f6-3e0a04ee2769.png</url>
      <title>DEV Community: Mockzilla</title>
      <link>https://dev.to/mockzilla</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mockzilla"/>
    <language>en</language>
    <item>
      <title>Reimporting Stripe's new OpenAPI spec into Mockoon left 559 routes on the old API</title>
      <dc:creator>Mockzilla</dc:creator>
      <pubDate>Tue, 15 Sep 2026 12:18:08 +0000</pubDate>
      <link>https://dev.to/mockzilla/reimporting-stripes-new-openapi-spec-into-mockoon-left-559-routes-on-the-old-api-42n4</link>
      <guid>https://dev.to/mockzilla/reimporting-stripes-new-openapi-spec-into-mockoon-left-559-routes-on-the-old-api-42n4</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I work on Mockzilla, which competes with Mockoon. Everything below&lt;br&gt;
was run on one laptop, and there is a link to the longer comparison at the end.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Mockoon is a quick way to get a Stripe mock running. Import Stripe's OpenAPI&lt;br&gt;
spec into the desktop app, fix the responses your tests care about, and every&lt;br&gt;
route answers on &lt;code&gt;localhost:3000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Then Stripe ships a new API version, and you import the new spec over the old&lt;br&gt;
one.&lt;/p&gt;
&lt;h2&gt;
  
  
  What basil moved
&lt;/h2&gt;

&lt;p&gt;In March 2025 Stripe released an API version called &lt;code&gt;basil&lt;/code&gt;. It moved&lt;br&gt;
&lt;code&gt;current_period_start&lt;/code&gt; and &lt;code&gt;current_period_end&lt;/code&gt; from the subscription to each&lt;br&gt;
subscription item. If your code handles subscriptions, it probably reads one of&lt;br&gt;
them.&lt;/p&gt;
&lt;h2&gt;
  
  
  The reimport
&lt;/h2&gt;

&lt;p&gt;When you import a spec, Mockoon converts it into its own file format, and from&lt;br&gt;
then on that file is what you edit and run. Stripe's spec is 6.4 MB. The Mockoon&lt;br&gt;
file it turns into is 30.5 MB. Mockoon's own documentation calls import "a good&lt;br&gt;
starting point but not a way to share your mock APIs".&lt;/p&gt;

&lt;p&gt;Reimport only adds. From the same docs: "No existing routes or responses will be&lt;br&gt;
modified or deleted".&lt;/p&gt;

&lt;p&gt;I imported the Stripe spec from before &lt;code&gt;basil&lt;/code&gt;, then reimported the &lt;code&gt;basil&lt;/code&gt; one.&lt;br&gt;
Mockoon added 2 new routes. The other 559 stayed as they were, this one&lt;br&gt;
included:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; localhost:3000/v1/subscriptions/sub_123 &lt;span class="se"&gt;\&lt;/span&gt;
    | jq &lt;span class="s1"&gt;'{current_period_end, item_period_end: .items.data[0].current_period_end}'&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"current_period_end"&lt;/span&gt;: 13345,
  &lt;span class="s2"&gt;"item_period_end"&lt;/span&gt;: null
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code already updated for &lt;code&gt;basil&lt;/code&gt; reads the item and gets &lt;code&gt;null&lt;/code&gt;. Older code&lt;br&gt;
reads the top-level field, and its tests pass against a field Stripe no longer&lt;br&gt;
sends. Two endpoints that &lt;code&gt;basil&lt;/code&gt; removed still answer 200.&lt;/p&gt;

&lt;p&gt;To get a changed route from the new spec, you delete the route and import&lt;br&gt;
again. That also deletes whatever you had edited in it.&lt;/p&gt;
&lt;h2&gt;
  
  
  The empty strings
&lt;/h2&gt;

&lt;p&gt;You will have edited some routes, because Mockoon fills Stripe's text fields&lt;br&gt;
with empty strings. Create a customer the way a test would:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; localhost:3000/v1/customers &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;email&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;jenny@example.com &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"name=Jenny Rosen"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    | jq &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'{id, object, email, name, currency}'&lt;/span&gt;
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"id"&lt;/span&gt;:&lt;span class="s2"&gt;""&lt;/span&gt;,&lt;span class="s2"&gt;"object"&lt;/span&gt;:&lt;span class="s2"&gt;"customer"&lt;/span&gt;,&lt;span class="s2"&gt;"email"&lt;/span&gt;:&lt;span class="s2"&gt;""&lt;/span&gt;,&lt;span class="s2"&gt;"name"&lt;/span&gt;:&lt;span class="s2"&gt;""&lt;/span&gt;,&lt;span class="s2"&gt;"currency"&lt;/span&gt;:&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Across the whole Stripe mock, 223,537 fields are empty, and &lt;code&gt;currency&lt;/code&gt; alone is&lt;br&gt;
empty in 4,641 places. The empty &lt;code&gt;id&lt;/code&gt; breaks the next step of the test: fetching&lt;br&gt;
that customer requests &lt;code&gt;/v1/customers/&lt;/code&gt;, and that route answers with the&lt;br&gt;
customer list.&lt;/p&gt;

&lt;p&gt;The fix is per route: open the route and edit its response body, for example&lt;br&gt;
with a template helper that copies the email from the request. A route you fixed&lt;br&gt;
stays on the old spec after every reimport.&lt;/p&gt;
&lt;h2&gt;
  
  
  Start-up and memory
&lt;/h2&gt;

&lt;p&gt;Mockoon handles the full Stripe spec. Prism, for one, did not open a port on it&lt;br&gt;
in 30 minutes. I ran both tools on Stripe's current spec, three runs each, timed&lt;br&gt;
from launch to first response:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stripe, 6.4 MB&lt;/th&gt;
&lt;th&gt;Mockoon CLI 9.8.0&lt;/th&gt;
&lt;th&gt;Mockzilla 2.8.16&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First response, from the spec&lt;/td&gt;
&lt;td&gt;1,335 to 1,386 ms&lt;/td&gt;
&lt;td&gt;210 to 242 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory, warm&lt;/td&gt;
&lt;td&gt;477 to 487 MiB&lt;/td&gt;
&lt;td&gt;194 MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;First response, from the converted file&lt;/td&gt;
&lt;td&gt;457 to 488 ms at 280 MiB&lt;/td&gt;
&lt;td&gt;no such file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What you install&lt;/td&gt;
&lt;td&gt;Node.js and 252 npm packages, 103 MB&lt;/td&gt;
&lt;td&gt;one 40 MiB binary&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The CLI converts the spec again on every start, which is where the extra second&lt;br&gt;
goes. On a laptop none of this matters much. CI pays it in every job, and&lt;br&gt;
Mockoon's GitHub Action spent 8 to 10 seconds on the npm install alone.&lt;/p&gt;
&lt;h2&gt;
  
  
  When Mockoon is the better choice
&lt;/h2&gt;

&lt;p&gt;If your API has no OpenAPI spec, use Mockoon. You build the routes by hand in&lt;br&gt;
its desktop app and set each response by clicking.&lt;/p&gt;

&lt;p&gt;A Mockoon route can also hold several responses and pick one by rule, such as a&lt;br&gt;
402 when the request contains &lt;code&gt;pm_card_visa_chargeDeclined&lt;/code&gt;, Stripe's test&lt;br&gt;
payment method for a declined card. Callbacks send a follow-up request after a&lt;br&gt;
call, which is how you fake a webhook. A record you create with POST comes back&lt;br&gt;
on GET. Mockzilla needs Go code to pick a response by request, keeps no data&lt;br&gt;
between calls, and does not read the Swagger 2.0 files Mockoon accepts.&lt;/p&gt;
&lt;h2&gt;
  
  
  If your mock starts from a spec
&lt;/h2&gt;

&lt;p&gt;The other approach is a mock server that reads the spec on every start.&lt;br&gt;
Replacing the file is the update. Given the &lt;code&gt;basil&lt;/code&gt; spec, Mockzilla puts the&lt;br&gt;
period fields on the item and answers 404 on the two removed endpoints.&lt;/p&gt;

&lt;p&gt;The fixes go in a separate file next to the spec, keyed by field name:&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="na"&gt;currency&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;usd"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;eur"&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gbp"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;in-response&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;request:email"&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;request:name"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One &lt;code&gt;currency&lt;/code&gt; line covers every &lt;code&gt;currency&lt;/code&gt; field in Stripe's responses. When&lt;br&gt;
Stripe ships the next version you replace the spec and keep this file.&lt;/p&gt;

&lt;p&gt;The full comparison has both tools side by side, latency and error settings,&lt;br&gt;
replay, what CI looks like on each side, and the prices:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mockzilla.org/en/articles/mockoon-alternative" rel="noopener noreferrer"&gt;Mockoon alternative: keep your mock API in sync with your OpenAPI spec&lt;/a&gt;&lt;/p&gt;

</description>
      <category>openapi</category>
      <category>testing</category>
      <category>api</category>
      <category>stripe</category>
    </item>
    <item>
      <title>Prism spent 30 minutes on Stripe's OpenAPI spec and never opened a port</title>
      <dc:creator>Mockzilla</dc:creator>
      <pubDate>Fri, 11 Sep 2026 10:04:38 +0000</pubDate>
      <link>https://dev.to/mockzilla/prism-spent-30-minutes-on-stripes-openapi-spec-and-never-opened-a-port-1mnl</link>
      <guid>https://dev.to/mockzilla/prism-spent-30-minutes-on-stripes-openapi-spec-and-never-opened-a-port-1mnl</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I work on Mockzilla, which competes with Stoplight Prism.&lt;br&gt;
Everything below was measured on my laptop, and there is a link to the longer&lt;br&gt;
comparison at the end.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Prism is the default answer to "I need to mock this OpenAPI spec", and for most&lt;br&gt;
specs it is the right one. Install it, point it at a document, every operation&lt;br&gt;
in the file answers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @stoplight/prism-cli
prism mock openapi.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I gave it Stripe.&lt;/p&gt;

&lt;h2&gt;
  
  
  The run
&lt;/h2&gt;

&lt;p&gt;Stripe publishes its API as an OpenAPI document. The copy I used is 6.0 MB, 414&lt;br&gt;
paths and 587 operations. Large, but not unusual: GitHub's is 8.8 MB.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ prism mock stripe.yml
[CLI] …  awaiting  Starting Prism…
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing followed it. Thirty minutes on it was still that one line, the&lt;br&gt;
process pinned at 100% of a core with 216 MiB resident and nothing listening on&lt;br&gt;
port 4010. That is where I stopped it.&lt;/p&gt;

&lt;p&gt;Handing it JSON instead does not help. The same document as &lt;code&gt;stripe.json&lt;/code&gt;, same&lt;br&gt;
machine: no listener after fifteen minutes, at 274 MiB. There is no flag for&lt;br&gt;
this and nothing was misconfigured.&lt;/p&gt;
&lt;h2&gt;
  
  
  Where the time goes
&lt;/h2&gt;

&lt;p&gt;Not parsing. Python's YAML parser loads the same file in 5.3 seconds.&lt;/p&gt;

&lt;p&gt;It goes on resolution. Stripe's document carries 1,286 component schemas with&lt;br&gt;
3,700 &lt;code&gt;$ref&lt;/code&gt;s pointing into them, and Prism walks all of that before it binds a&lt;br&gt;
port. A spec with a few hundred inline schemas never shows you this.&lt;/p&gt;

&lt;p&gt;The file itself is servable. The mock server I work on opens a port on the same&lt;br&gt;
document in 195 ms and answers the first request at 364 ms.&lt;/p&gt;
&lt;h2&gt;
  
  
  What it costs on a spec that does work
&lt;/h2&gt;

&lt;p&gt;Twilio Verify: 29 paths, 53 operations, 173 KB of YAML. Installed natively,&lt;br&gt;
three runs.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Prism 5.16.0&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Start to first response&lt;/td&gt;
&lt;td&gt;509 to 531 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory, warm&lt;/td&gt;
&lt;td&gt;191 to 199 MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;What you install&lt;/td&gt;
&lt;td&gt;210 npm packages, 68 MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Half a second and 200 MB is nothing on a laptop. A container that boots and&lt;br&gt;
dies on every CI job pays it every time.&lt;/p&gt;
&lt;h2&gt;
  
  
  One process, one document
&lt;/h2&gt;

&lt;p&gt;"A single Prism instance serves one OpenAPI document." Prism's documentation&lt;br&gt;
says so, and what it recommends for a second document is a second process on a&lt;br&gt;
second port with a reverse proxy in front of both:&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="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;proxy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;caddy&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;8080:80'&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;prism_1&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;prism_2&lt;/span&gt;
  &lt;span class="na"&gt;prism_1&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stoplight/prism:4&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mock -p 4010 --host 0.0.0.0 petstore-v2.yaml&lt;/span&gt;
  &lt;span class="na"&gt;prism_2&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stoplight/prism:4&lt;/span&gt;
    &lt;span class="na"&gt;command&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mock -p 4010 --host 0.0.0.0 petstore-v3.yaml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most test suites talk to more than one vendor. Three of them is three Node&lt;br&gt;
processes, three ports, a Caddyfile and something to supervise the lot, on&lt;br&gt;
every developer machine and in every CI job. Each process holds its own copy of&lt;br&gt;
its own document, so the 191 to 199 MiB above is per API rather than per&lt;br&gt;
machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Prism does better
&lt;/h2&gt;

&lt;p&gt;Three things, and if you need the first one this post ends here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forcing a status code, per request.&lt;/strong&gt; &lt;code&gt;Prefer: code=404&lt;/code&gt; on any call, or&lt;br&gt;
&lt;code&gt;?__code=404&lt;/code&gt; if a header is awkward, and Prism serves that response out of the&lt;br&gt;
document. Ask for a code the document does not declare and you still get the&lt;br&gt;
status, with a Prism error body saying so. What I run has no per-request&lt;br&gt;
equivalent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enforcing the document's security.&lt;/strong&gt; Twilio Verify declares HTTP basic auth,&lt;br&gt;
so Prism answers 401 with a &lt;code&gt;WWW-Authenticate&lt;/code&gt; header until you send&lt;br&gt;
credentials. Prism's behaviour is the contract-accurate one, and it catches a&lt;br&gt;
client that forgot to send a token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Older and stranger documents.&lt;/strong&gt; OpenAPI 2.0, the version still called&lt;br&gt;
Swagger, and Postman Collections. If your document has not been converted yet,&lt;br&gt;
that decides it.&lt;/p&gt;

&lt;h2&gt;
  
  
  If your spec is the big kind
&lt;/h2&gt;

&lt;p&gt;A mock server that reads the document at start-up and resolves all of it has a&lt;br&gt;
ceiling, and Stripe's spec is above it. Worth knowing before you put &lt;code&gt;prism&lt;br&gt;
mock&lt;/code&gt; in a CI job and find out from a timeout.&lt;/p&gt;

&lt;p&gt;I wrote up the full comparison with both tools running the same specs, the&lt;br&gt;
generated data either side, the per-request controls, and the prices:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mockzilla.org/en/articles/stoplight-prism-alternative" rel="noopener noreferrer"&gt;Stoplight Prism alternative: an OpenAPI mock server with a URL&lt;/a&gt;&lt;/p&gt;

</description>
      <category>openapi</category>
      <category>testing</category>
      <category>node</category>
      <category>api</category>
    </item>
    <item>
      <title>WireMock will not read your OpenAPI spec, and that is on purpose</title>
      <dc:creator>Mockzilla</dc:creator>
      <pubDate>Fri, 04 Sep 2026 14:04:14 +0000</pubDate>
      <link>https://dev.to/mockzilla/wiremock-will-not-read-your-openapi-spec-and-that-is-on-purpose-a5j</link>
      <guid>https://dev.to/mockzilla/wiremock-will-not-read-your-openapi-spec-and-that-is-on-purpose-a5j</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I work on Mockzilla, which competes with WireMock. Everything below&lt;br&gt;
was run on my laptop today and every claim links to its source. There is a link&lt;br&gt;
to the longer comparison at the end, and you can stop reading before it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You have an OpenAPI document. You want a mock server. WireMock is what most&lt;br&gt;
people find first, so you start the container and give it your spec.&lt;/p&gt;

&lt;p&gt;It will not read it.&lt;/p&gt;
&lt;h2&gt;
  
  
  Two ways it fails
&lt;/h2&gt;

&lt;p&gt;Drop the spec where WireMock keeps its stubs and start it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 8080:8080 &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$PWD&lt;/span&gt;&lt;span class="s2"&gt;/wiremock:/home/wiremock"&lt;/span&gt; wiremock/wiremock:3.13.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The container comes up. It also loaded nothing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; localhost:8080/__admin/mappings | jq .meta
&lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="s2"&gt;"total"&lt;/span&gt;: 0 &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;WireMock reads &lt;code&gt;.json&lt;/code&gt; from that directory and ignores everything else, so a&lt;br&gt;
&lt;code&gt;.yml&lt;/code&gt; spec sits there in silence. Convert it to JSON, which is the obvious next&lt;br&gt;
move, and the container stops starting at all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MappingFileException: Error loading file /home/wiremock/./mappings/openapi.json:
Unrecognized field "openapi" (class ...StubMappingCollection), not marked as ignorable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;openapi&lt;/code&gt; is an unrecognized field.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why
&lt;/h2&gt;

&lt;p&gt;This is not an oversight. OpenAPI import is a WireMock Cloud feature and the&lt;br&gt;
open source version has never had it. Somebody &lt;a href="https://github.com/wiremock/wiremock/issues/976" rel="noopener noreferrer"&gt;asked for it in August 2018&lt;/a&gt;, and &lt;a href="https://github.com/wiremock/wiremock/issues/976#issuecomment-412055701" rel="noopener noreferrer"&gt;the answer&lt;/a&gt; came the next morning from WireMock's creator:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I don't have any plans to open source MockLab's implementation at the moment.&lt;br&gt;
I'd suggest if you want to work on this that you make it an extension.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;MockLab was the earlier name of WireMock Cloud. Eight years on, the feature is&lt;br&gt;
still on that side of the line.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you write instead
&lt;/h2&gt;

&lt;p&gt;One JSON file per stub, each holding a &lt;code&gt;request&lt;/code&gt; matcher and a &lt;code&gt;response&lt;/code&gt;. A&lt;br&gt;
minimal one for a single endpoint runs about 25 lines, and it covers exactly&lt;br&gt;
that endpoint. Ask for the next path along and you get &lt;code&gt;Request was not matched&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Twilio Verify is a small API: 29 paths, 53 operations. That is 53 stub files,&lt;br&gt;
and every field in them is a response shape you looked up by hand and typed.&lt;br&gt;
GitHub's public API description is 551 paths and 845 operations.&lt;/p&gt;

&lt;p&gt;Then there is the part that shows up later. Your spec and your stubs are now two&lt;br&gt;
descriptions of the same API, maintained at different times, and only one of&lt;br&gt;
them is what the service implements. Somebody has published a GitHub Action&lt;br&gt;
called &lt;a href="https://github.com/tidusjar/Wiremock.OpenAPIValidator" rel="noopener noreferrer"&gt;WireMock OpenAPI Validator&lt;/a&gt;&lt;br&gt;
whose entire job is checking stub mappings against a spec in CI, and it&lt;br&gt;
describes itself as "perfect for ensuring your mocks stay in sync with your API&lt;br&gt;
contracts".&lt;/p&gt;

&lt;h2&gt;
  
  
  This is not a bug report
&lt;/h2&gt;

&lt;p&gt;WireMock's unit of work is a stub: one matcher, one canned response. A spec is&lt;br&gt;
not a stub, so the tool is consistent with what it is. The project is also in&lt;br&gt;
good health, with 3.13.2 shipped in November 2025 and v4 in beta.&lt;/p&gt;

&lt;p&gt;Three things it does that a spec-driven mock does not. WireMock runs inside your&lt;br&gt;
test process, in Java and through wrappers in .NET, Python, Go and Rust. You can&lt;br&gt;
assert on the requests your code sent, so &lt;code&gt;verify(getRequestedFor(...))&lt;/code&gt; fails&lt;br&gt;
the test when the call never happened. And its scenarios move a stub between&lt;br&gt;
states, so the same call answers differently the second time.&lt;/p&gt;

&lt;p&gt;If you need any of those, none of this matters and WireMock is your answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you do have a spec
&lt;/h2&gt;

&lt;p&gt;The alternative is a server that takes the document as its input, so the mock&lt;br&gt;
and the contract are one file. I wrote up the full comparison with both tools&lt;br&gt;
running the same API side by side, including the measurements, the per-endpoint&lt;br&gt;
cost, and where WireMock still wins:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mockzilla.org/en/articles/wiremock-alternative-openapi" rel="noopener noreferrer"&gt;WireMock alternative: mock an OpenAPI spec without writing stubs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>openapi</category>
      <category>java</category>
      <category>testing</category>
      <category>api</category>
    </item>
  </channel>
</rss>
