Mocking APIs with Complexed Data in Minutes

Discover how to effortlessly mock complex APIs in just minutes with Apidog. This guide walks you through importing API definitions, customizing mock rules for enums, arrays, and schema-referenced objects, and generating mock URLs—no coding required.

Ismail Kamil

Ismail Kamil

9 February 2026

Mocking APIs with Complexed Data in Minutes

Apidog for Enterprise

On-Premises Deploy

SSO & RBAC

SOC 2 Compliant

Explore Apidog Enterprise

Many developers have found our previous blog, "Mocking an API in ONE Minute," useful, and you might too. That blog covered a quick way to mock an API, but it only scratched the surface. As I dug deeper into Apidog, I uncovered additional features that make mocking even complex data faster.

API Mocking: Everything You Need to Know
Learn how API Mocking enhances development by simulating services before they’re ready. Apidog offers a no-code, intuitive platform to mock APIs, perfect for early testing, saving costs, and seamless collaboration. From local to cloud mocking, explore Apidog’s versatile features for developers.

Handling APIs with Complex JSON Data

Let’s start with how to import a Swagger API into Apidog to mock JSON data. This way, you can generate mock data without writing any scripts.

However, some fields can be tricky to mock without additional configuration. For instance:

Fortunately, with Apidog, you can mock these complex JSON fields in just two minutes.

How to Mock APIs with Complexed JSON Data Quickly?

Apidog An integrated platform for API design, debugging, development, mock, and testing
REAL API Design-first Development Platform. Design. Debug. Test. Document. Mock. Build APIs Faster & Together.

Here’s a simple three-step process to mock complex APIs using Apidog:

  1. Import API definitions.
  2. Customize API mock rules for specific fields.
  3. Get the mock URL.

It’s that easy. Let’s go through it.

Step 1: Import API Definitions

You only need an OpenAPI JSON or YAML file. Import it into Apidog, and you're ready to go.

Importing openAPI specifications into Apidog

Step 2: Customize API Mock Rules for Specific Fields

Enum values:
In our sample API, the 'status' field has three options: available, pending, and sold. We want our mock data to reflect only one of these values.
Click 'Advanced settings' in the 'Status' field, enable the 'Enum' switch, and add the enum values. Now, this field will only mock one of these values.

Customizing enum values for API mocking at Apidog

Fixed-length arrays:

For the 'PhotoUrls' array field, we need exactly five items.

In the 'Advanced settings' of the 'PhotoUrls' field, adjust the 'Element Limit' settings. Set both 'minItems' and 'maxItems' to 5.

Customizing API mock rules at Apidog

Schema-referenced objects:

Apidog support schemas as per the OpenAPI specification. If an object refers to a schema, Apidog will mock it accordingly. For example, you can reference the schema for the 'Category' field.

Reference other schemas for specific fields for API mocking

Step 3: Get the API Mock URL

Click ‘Save', and switch to the 'Endpoint' tab. Copy the URL under the "Local Mock" section, which starts with "127.0.0.1".

Getting mock API URL configured at Apidog

Paste the URL into your browser, and you're done.

API mock data examples using Apidog

Notable Fields

When you check the mocked data, you’ll notice:

Other fields, like city and createdAt, are mocked automatically.

And if you refresh the URL, the mock data updates.

Refresh to update the API mock data at Apidog

Apidog Supports Mocking JSON Schema for APIs

Apidog is fully compatible with OpenAPI 3.0, which uses JSON Schema to define the structure of API data. All JSON Schema attributes are supported in Apidog, including:

Not just JSON, Apidog also supports mocking XML. You can even customize the XML tag names and prefixes.

Mocking XML data at Apidog

Thanks to JSON Schema, you can generate any complex mock data with just a few clicks using Apidog—no coding required.

button

Explore more

OpenAI Daybreak Blue vs Red: which cyber access tier gets which models

OpenAI Daybreak Blue vs Red: which cyber access tier gets which models

OpenAI split Daybreak into Blue and Red access tiers. Blue is de-guardrailed GPT-5.6 Sol for defenders; Red unlocks GPT-5.6-Cyber. Here's who each is for and how access works.

11 August 2026

How to Add AI Disclosure to Your Own API ?

How to Add AI Disclosure to Your Own API ?

Since Article 50 applied on August 2, 2026, the duty to disclose sits with whoever deploys the system, and your callers can only comply if your contract tells them what they are getting. The response shape, the OpenAPI schema, and the paths where the field always disappears.

11 August 2026

How to Detect Claude's Watermark (and Why a Clean Result Proves Nothing)

How to Detect Claude's Watermark (and Why a Clean Result Proves Nothing)

Claude's C2PA file manifests can be verified right now with c2patool or the Content Credentials page. Its embedded text watermark cannot be read by anyone outside Anthropic yet. Plus the asymmetry that makes a negative detection result worthless.

11 August 2026

Practice API Design-first in Apidog

Discover an easier way to build and use APIs

Mocking APIs with Complexed Data in Minutes