Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:APIJSON APIJSON Demo API Response Validation

From Leeroopedia
Knowledge Sources
Domains Validation, Testing, API_Design
Last Updated 2026-10-14 00:00 GMT

Overview

Technique for validating and comparing APIJSON HTTP responses against expected standards using structural diff comparison with optional ML tolerance.

Description

API Response Validation checks APIJSON response status codes, extracts standard fields (code, msg, count, total), and performs deep structural comparison between actual responses and expected standards. It supports ML tolerance mode for flexible matching and can update standards incrementally based on observed responses.

This solves:

  • Regression testing: Detecting breaking changes in API responses automatically.
  • Standard maintenance: Updating expected response standards as APIs evolve.
  • ML tolerance: Allowing minor variations in responses without flagging false positives.

Usage

Use this principle when:

  • Building automated API regression test suites.
  • You need to compare actual vs. expected API responses with structural awareness.
  • Maintaining evolving API response standards across API versions.

Theoretical Basis

Validation Pipeline:

    HTTP Response
        │
        ▼
    [1] Extract: code, msg, count, total from response
        │
        ▼
    [2] Check: code == 200 (success)?
        │
        ▼
    [3] Compare (optional):
        - Deep diff: standard vs. response
        - Detect: add, remove, update, change
        - ML mode: tolerate type/variance
        │
        ▼
    [4] Update Standard (optional):
        - Merge new fields from response into standard
        - Preserve expected types

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment