Apidog Docs
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
Discord Community
Slack Community
X / Twitter
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
  1. Develop and Debug APIs
  • Apidog Learning Center
  • Getting Started
    • Introduction to Apidog
    • Basic Concepts in Apidog
    • Navigating Apidog
    • Quick Start
      • Overview
      • Creating an Endpoint
      • Making a Request
      • Adding an Assertion
      • Creating Test Scenarios
      • Sharing API Documentation
      • Explore More
    • Migration to Apidog
      • Overview
      • Manual Import
      • Scheduled Import (Bind Data Sources)
      • Import Options
      • Export Data
      • Import From
        • Import from Postman
        • Import OpenAPI Spec
        • Import cURL
        • Import Markdowns
        • Import from Insomnia
        • Import from apiDoc
        • Import .har File
        • Import WSDL
  • Design APIs
    • Overview
    • Create a New API Project
    • Endpoint Basics
    • APl Design Guidelines
    • Module
    • Configure Multiple Request Body Examples
    • Components
    • Common Fields
    • Global Parameters
    • Endpoint Change History
    • Comments
    • Batch Endpoint Management
    • Custom Protocol API
    • Schemas
      • Overview
      • Create a New Schema
      • Build a Schema
      • Generate Schemas from JSON Etc
      • oneOf, allOf, anyOf
      • Using Discriminator
    • Security Schemes
      • Overview
      • Create a Security Scheme
      • Use the Security Scheme
      • Security Scheme in Online Documentation
    • Advanced Features
      • Custom Endpoint Fields
      • Associated Test Scenarios
      • Endpoint Status
      • Appearance of Parameter Lists
      • Endpoint Unique Identification
  • Develop and Debug APIs
    • Overview
    • Generating Requests
    • Sending Requests
    • Debugging Cases
    • Test Cases
    • Dynamic Values
    • Validating Responses
    • Design-First vs Request-First
    • Generating Code
    • Environments & Variables
      • Overview
      • Environment Management
      • Using Variables
    • Vault Secrets
      • Overview
      • HashiCorp Vault
      • Azure Key Vault
      • AWS Secrets Manager
    • Pre and Post Processors
      • Assertion
      • Extract Variable
      • Wait
      • Overview
      • Database Operations
        • Overview
        • MySQL
        • MongoDB
        • Redis
        • Oracle Client
      • Using Scripts
        • Overview
        • Pre Processor Scripts
        • Post Processor Scripts
        • Public Scripts
        • Postman Scripts Reference
        • Calling Other Programming Languages
        • Using JS Libraries
        • Visualizing Responses
        • Script Examples
          • Assertion Scripts
          • Using Variables
          • Modifying Requests
          • Other Examples
    • Dynamic Values Modules
  • Mock API data
    • Overview
    • Smart mock
    • Custom mock
    • Mock priority sequence
    • Mock scripts
    • Cloud mock
    • Self-hosted runner mock
    • Mock language (Locales)
  • API Testing
    • Overview
    • Test scenarios
      • Create a test scenario
      • Pass data between requests
      • Flow control conditions
      • Sync data from endpoints or endpoint cases
      • Import endpoints or endpoint cases from other projects
      • Export test scenarios
    • Run test scenarios
      • Run a test scenario
      • Run test scenarios in batch
      • Manage the runtime environment of APIs from other projects
      • Data-driven testing
      • Scheduled tasks
    • Test Suite
      • Overview
      • Create a test suite
      • Orchestrate test suite
      • Run test suite locally
      • Run test suites via CLI
      • Scheduled tasks
    • Test reports
      • Test reports
    • Test APIs
      • Integration testing
      • Performance testing
      • End-to-end testing
      • Regression testing
      • Contract testing
    • Apidog CLI
      • Overview
      • Installing and running Apidog CLI
      • Apidog CLI Options
    • CI CD
      • Overview
      • Integrate with Gitlab
      • Integrate with Jenkins
      • Trigger Test by Git Commit
      • Integrate with Github Actions
  • Publish API Docs
    • Overview
    • API Technologies Supported
    • Quick share
    • View the API documentation
    • Markdown documentations
    • Publish docs sites
    • Custom layouts
    • Custom CSS, JavaScript, HTML
    • Custom domain
    • LLM-friendly Features
    • SEO settings
    • Advanced Settings
      • Documentation Search
      • CORS Proxy
      • Integrating Google Analytics with Doc Sites
      • Folder tree settings
      • Visibility settings
      • Embedding values in document URLs
    • API Versions
      • Overview
      • Create API versions
      • Publish API versions
      • Share endpoints with API versions
  • Send requests
    • Overview
    • SSE debugging
    • Socket.IO
    • WebSocket
    • Webhook
    • SOAP or WebService
    • GraphQL
    • gRPC
    • Use request proxy agents for debugging
    • Create requests
      • Request History
      • Request basics
      • Parameters and body
      • Request headers
      • Request settings
      • Debug requests
      • Save the request as an endpoint
      • HTTP2
    • Response and cookies
      • Overview
      • API response in Apidog
      • Create and send cookies
    • Authentication and authorization
      • Overview
      • CA and client certificates
      • Authorization types supported by Apidog
      • Digest Auth
      • OAuth 1.0
      • OAuth 2.0
      • Hawk Authentication
      • Kerberos
      • NTLM
      • Akamai EdgeGrid
  • Branches
    • Overview
    • Create a new sprint branch
    • Test APIs in a branch
    • Design API in a branch
    • Merge sprint branches
    • Manage sprint branches
  • AI Features
    • Overview
    • Enable AI features
    • Generate Test Cases
    • Modify schemas with AI
    • Endpoint compliance check
    • API documentation completeness check
    • AI naming
    • FAQs
  • Apidog MCP Server
    • Overview
    • Connect API Specification within Apidog Project to AI via Apidog MCP Server
    • Connect Online API Documentation Published by Apidog to AI via Apidog MCP Server
    • Connect OpenAPI Files to AI via Apidog MCP Server
  • Best Practices
    • How to handle API signatures
    • How to access OAuth 2.0 protected APIs
    • Apidog collaboration workflow
    • Managing authentication state in Apidog
  • Offline Space
    • Overview
  • Administration
    • Onboarding Checklist
      • Basic Concepts
      • Onboarding Guide
    • Managing teams
      • Managing Teams
      • Managing Team Members
      • Member Roles & Permission Settings
      • Team Activities
      • Team Resources
        • General Runner
        • Team Variables
        • Request Proxy Agent
      • Real-time Collaborations
        • Team Collaboration
    • Managing Projects
      • Managing Projects
      • Managing Project Members
      • Notification Settings
      • Project Resources
        • Database Connection
        • Git Connection
    • Managing Organization
      • Managing Organization
      • Single Sign-On (SSO)
        • SSO Overview
        • Configure Microsoft Entra ID
        • Configure Okta
        • Configure SSO for an Organization
        • Managing user accounts
        • Mapping Groups to Teams
      • SCIM Provisioning
        • Intro to SCIM Provisioning
        • Microsoft Entra ID
        • Okta
      • Organization Resources
        • Self-hosted Runner
      • Plans management
        • Billing managers in organization
  • Billing
    • Overview
    • Credits
    • Unable to use credit cards
    • Managing subscriptions
    • Upgrade plan
    • How to move a paid team to a organization
  • Data & Security
    • Apidog data storage location and security
    • User data privacy and storage location
    • Request routing and data security
  • Add-ons
    • API Hub
    • Apidog Intellij IDEA plugin
    • Browser Extension
      • Chrome
      • Microsoft Edge
    • Request Proxy
      • Request proxy in Apidog web
      • Request proxy in shared docs
      • Request proxy in Apidog client
  • Account & preferences
    • Account settings
    • Generate OpenAPI access token
    • Notification
    • Language settings
    • Hot keys
    • Network proxy configuration
    • Data backup
    • Updating Apidog
    • Deleting account
    • Experimental Features
  • References
    • API-Design First Approach
    • Apidog OpenAPI Specificaiton Extensions
    • JSONPath
    • XPath
    • Regular Expressions
    • JSON Schema
    • CSV File Format
    • Install Java Environment
    • Runner deployment environment
    • Apidog flavored Markdown
  • Apidog Europe
    • Apidog Europe
  • Support Center
  • Schemas
    • MinifiedFestivalType
    • DateType
    • LocationType
    • ArtistType
    • FestivalType
    • GetAllFestivalsResponseType
    • GetFestivalByIdResponseType
    • UserType
    • GetUserResponseType
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
HomeLearning Center
Support CenterAPI ReferencesDownloadChangelog
Discord Community
Slack Community
X / Twitter
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
πŸ‡ΊπŸ‡Έ English
  • πŸ‡ΊπŸ‡Έ English
  • πŸ‡―πŸ‡΅ ζ—₯本θͺž
  1. Develop and Debug APIs

Validating Responses

In Apidog, after sending a request within an endpoint, Apidog automatically validates whether the response conforms to the schema based on the endpoint's specification.

Validate Rules#

Scope of Validation#

HTTP Status Code: Returned by the API.
Data Format: Of the returned content (JSON, XML, HTML, Raw, Binary, No-Content, MsgPack, Event-Stream).
Schemas: Only JSON and XML can configure schemas. For detailed explanation of data structure, please refer Schemas.
Validation ItemProperty typeValidation Prompt Example
Required key existenceAll$ should have required property "code"
Value type matches specAll$.data.id should be integer
Non-null key must not have null valueAll$.data.id should be integer
Enumerated value within rangeString, Integer, Number$.data.status should be equal to one of predefined values
Numeric value within rangeInteger, Number$.data.id should be >= 0
Numeric value follows multiple requirementInteger, Number$.data.quantity should be a multiple of 10
String length within rangeString$.data.name should not be shorter than 3 characters
String matches patternString$.data.name should match pattern "^[A-Za-z]"
Array element count within rangeArray$.data.tags should not have more than 2 items

What to Do Next#

If the above points are consistent, it will display "Response Data Structure validated!". This means that the actual API return values are consistent with the API documentation specification, eliminating the need for manual verification and improving the efficiency.
When you encounter the corresponding prompts on the right, you can follow the prompts to solve the issue.
There are generally two types of problems: the first is when the server's response is incorrect, in which case the backend needs to be modified to align with the specification; the second is when the API specification is incorrect, requiring modification of the endpoint spec.
By utilizing the automatic validation feature, you can eliminate the need to manually write scripts to validate responses. Furthermore, when there are changes to the API specification, the validation will also automatically adjust accordingly.

Validating Other Responses#

By default, Apidog validates the first response in the endpoint, typically a 200 response. However, an endpoint may return multiple different responses with different schemas. In such cases, you can choose which response to validate in the validation area's top right corner.
You also have the option to toggle the "validate" feature off by clicking the switch in front of the response. This change only applies to the current endpoint.

Validate Additional Properties#

As the actual business upgrades, additional properties may be added to the response. In such cases, Apidog allows users to determine whether to allow additional fields.
For example, there is an API for querying user information, and the previous return fields were name and phone. Therefore, the data structure was specified like:
With the business upgrade, a new city field was added to this API, but the API spec was not updated. According to default validation mechanism, no error will be reported, meaning that adding additional fields is allowed by default.
However, for more strict development scenarios, if the return value contains additional fields that do not match the definition, the response validation should also report an error. In this case, you can achieve the desired behavior by following these steps:
1.
Modify the response in the API spec. In the advanced settings of the object, configure "additionalProperties" to "Deny", which will only take effect for the current API.
2.
If you want to disallow additional fields for all API in the project, you can go to Settings β†’ Response Validate Settings and turn off Allow Objects to Have additionalProperties.
3.
After completing the configuration, when sending the request again, the response validation mechanism will report an error, indicating that additionalProperties are not allowed.

Validation Settings#

The "Validate Response" switch is turned on by default, and you can adjust it in the "Verification Response Settings" in the project settings interface. This setting only takes effect for all APIs in the current project and does not affect the saved Endpoint Cases.
If you only requires manual assertions or post-scripts and do not need Apidog to validate response consistency with the API specification, you can disable the validation function for specific modules.

Validate Response Content#

The validate response contains "HTTP Status", "Header", "Body", you can adjust it in the "Validate Response Content" in the project settings. This setting only takes effect for all API in the current project and does not affect the saved Endpoint Cases.
Modified atΒ 2026-01-14 09:10:00
Previous
Dynamic Values
Next
Design-First vs Request-First
Built with