Targeted JSON contract negative fixture composer
Compose invalid payloads from a caller-supplied valid seed with one structural edit, an exact target assertion and the complete bounded failed-assertion set.
api-assurance · Operation ID: json-contract-negative-cases
Choose this operation when
- generate targeted negative request payloads from a valid JSON seed and supported schema
- compose one-edit contract violations with checked constraint isolation
Outside this profile
- Target rejection guarantees, expected HTTP status, fuzz attacks or a mutation-testing score
- A valid seed is missing or incompatible with the supported structural schema
- Arbitrary JSON Schema, formats, regexes, references, combinators, nested objects or nested arrays
- Executing target tests, fetching services, running supplied code or proving security
Exact release references
Static JSON contract · Markdown reference · Fixed example response
Complete input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"schema": {
"$ref": "#/$defs/__schema0"
},
"seed": {
"$ref": "#/$defs/__schema0"
},
"mutations": {
"minItems": 1,
"maxItems": 64,
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"path": {
"type": "string",
"maxLength": 1024
},
"requireIsolated": {
"default": false,
"type": "boolean"
},
"kind": {
"type": "string",
"enum": [
"removeRequired",
"belowMinimum",
"aboveMaximum",
"shortenString",
"lengthenString",
"shortenArray",
"lengthenArray"
]
}
},
"required": [
"id",
"path",
"kind"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"path": {
"type": "string",
"maxLength": 1024
},
"requireIsolated": {
"default": false,
"type": "boolean"
},
"kind": {
"type": "string",
"const": "replaceType"
},
"replacementType": {
"type": "string",
"enum": [
"null",
"boolean",
"integer",
"number",
"string",
"array",
"object"
]
}
},
"required": [
"id",
"path",
"kind",
"replacementType"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"path": {
"type": "string",
"maxLength": 1024
},
"requireIsolated": {
"default": false,
"type": "boolean"
},
"kind": {
"type": "string",
"const": "outsideEnum"
},
"value": {
"anyOf": [
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "string",
"maxLength": 1024
}
]
}
},
"required": [
"id",
"path",
"kind",
"value"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"path": {
"type": "string",
"maxLength": 1024
},
"requireIsolated": {
"default": false,
"type": "boolean"
},
"kind": {
"type": "string",
"const": "addProperty"
},
"name": {
"type": "string",
"maxLength": 128
}
},
"required": [
"id",
"path",
"kind",
"name"
],
"additionalProperties": false
}
]
}
}
},
"required": [
"schema",
"seed",
"mutations"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/__schema0"
}
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/$defs/__schema0"
}
}
]
}
}
}
Complete output-envelope schema
{
"type": "object",
"required": [
"operation",
"version",
"result",
"provenance"
],
"properties": {
"operation": {
"const": "json-contract-negative-cases",
"type": "string"
},
"version": {
"const": "0.29.0",
"type": "string"
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"profile": {
"type": "string",
"const": "constructive-json-schema-v1"
},
"status": {
"type": "string",
"const": "complete"
},
"cases": {
"maxItems": 64,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"kind": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"generated",
"unavailable"
]
},
"value": {
"$ref": "#/properties/result/$defs/__schema0"
},
"patch": {
"anyOf": [
{
"oneOf": [
{
"type": "object",
"properties": {
"op": {
"type": "string",
"const": "remove"
},
"path": {
"type": "string"
}
},
"required": [
"op",
"path"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"op": {
"type": "string",
"enum": [
"add",
"replace"
]
},
"path": {
"type": "string"
},
"value": {
"$ref": "#/properties/result/$defs/__schema0"
}
},
"required": [
"op",
"path",
"value"
],
"additionalProperties": false
}
]
},
{
"type": "null"
}
]
},
"target": {
"anyOf": [
{
"type": "object",
"properties": {
"keyword": {
"type": "string",
"enum": [
"type",
"const",
"enum",
"minimum",
"maximum",
"minLength",
"maxLength",
"minItems",
"maxItems",
"required",
"additionalProperties"
]
},
"schemaPath": {
"type": "string"
},
"instancePath": {
"type": "string"
},
"property": {
"type": [
"string",
"null"
]
}
},
"required": [
"keyword",
"schemaPath",
"instancePath",
"property"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"failures": {
"type": "array",
"items": {
"type": "object",
"properties": {
"keyword": {
"type": "string",
"enum": [
"type",
"const",
"enum",
"minimum",
"maximum",
"minLength",
"maxLength",
"minItems",
"maxItems",
"required",
"additionalProperties"
]
},
"schemaPath": {
"type": "string"
},
"instancePath": {
"type": "string"
},
"property": {
"type": [
"string",
"null"
]
}
},
"required": [
"keyword",
"schemaPath",
"instancePath",
"property"
],
"additionalProperties": false
}
},
"isolated": {
"type": [
"boolean",
"null"
]
},
"reason": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"kind",
"status",
"patch",
"target",
"failures",
"isolated",
"reason"
],
"additionalProperties": false
}
},
"testing": {
"type": "object",
"properties": {
"targetExecuted": {
"type": "boolean",
"const": false
},
"behaviorVerified": {
"type": "boolean",
"const": false
},
"fullInputSpaceCoverage": {
"type": "boolean",
"const": false
}
},
"required": [
"targetExecuted",
"behaviorVerified",
"fullInputSpaceCoverage"
],
"additionalProperties": false
},
"metrics": {
"type": "object",
"properties": {
"schemaNodes": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"validatorNodeVisits": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"schemaNodes",
"validatorNodeVisits"
],
"additionalProperties": false
}
},
"required": [
"profile",
"status",
"cases",
"testing",
"metrics"
],
"additionalProperties": false,
"$defs": {
"__schema0": {
"anyOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"type": "array",
"items": {
"$ref": "#/properties/result/$defs/__schema0"
}
},
{
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"$ref": "#/properties/result/$defs/__schema0"
}
}
]
}
}
},
"provenance": {
"type": "object",
"required": [
"inputSha256",
"outputSha256",
"deterministic",
"externalRequests"
],
"properties": {
"inputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"outputSha256": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"deterministic": {
"const": true
},
"externalRequests": {
"const": 0
}
}
}
},
"additionalProperties": false
}
Fixed example
One accepted fixed example, not a custom-input trial. No operation runs when this static page is requested.
Example input
{
"schema": {
"type": "object",
"required": [
"count",
"mode"
],
"properties": {
"count": {
"type": "integer",
"minimum": 1,
"maximum": 3
},
"mode": {
"type": "string",
"enum": [
"fast",
"safe"
]
}
},
"additionalProperties": false
},
"seed": {
"count": 1,
"mode": "fast"
},
"mutations": [
{
"id": "missing",
"kind": "removeRequired",
"path": "/count",
"requireIsolated": true
},
{
"id": "small",
"kind": "belowMinimum",
"path": "/count",
"requireIsolated": true
},
{
"id": "large",
"kind": "aboveMaximum",
"path": "/count",
"requireIsolated": true
},
{
"id": "enum",
"kind": "outsideEnum",
"path": "/mode",
"value": "other",
"requireIsolated": true
},
{
"id": "extra",
"kind": "addProperty",
"path": "",
"name": "extra",
"requireIsolated": true
}
]
}
Example response
{
"operation": "json-contract-negative-cases",
"version": "0.29.0",
"result": {
"profile": "constructive-json-schema-v1",
"status": "complete",
"cases": [
{
"id": "missing",
"kind": "removeRequired",
"status": "generated",
"value": {
"mode": "fast"
},
"patch": {
"op": "remove",
"path": "/count"
},
"target": {
"keyword": "required",
"schemaPath": "/required/0",
"instancePath": "",
"property": "count"
},
"failures": [
{
"keyword": "required",
"schemaPath": "/required/0",
"instancePath": "",
"property": "count"
}
],
"isolated": true,
"reason": null
},
{
"id": "small",
"kind": "belowMinimum",
"status": "generated",
"value": {
"count": 0,
"mode": "fast"
},
"patch": {
"op": "replace",
"path": "/count",
"value": 0
},
"target": {
"keyword": "minimum",
"schemaPath": "/properties/count/minimum",
"instancePath": "/count",
"property": null
},
"failures": [
{
"keyword": "minimum",
"schemaPath": "/properties/count/minimum",
"instancePath": "/count",
"property": null
}
],
"isolated": true,
"reason": null
},
{
"id": "large",
"kind": "aboveMaximum",
"status": "generated",
"value": {
"count": 4,
"mode": "fast"
},
"patch": {
"op": "replace",
"path": "/count",
"value": 4
},
"target": {
"keyword": "maximum",
"schemaPath": "/properties/count/maximum",
"instancePath": "/count",
"property": null
},
"failures": [
{
"keyword": "maximum",
"schemaPath": "/properties/count/maximum",
"instancePath": "/count",
"property": null
}
],
"isolated": true,
"reason": null
},
{
"id": "enum",
"kind": "outsideEnum",
"status": "generated",
"value": {
"count": 1,
"mode": "other"
},
"patch": {
"op": "replace",
"path": "/mode",
"value": "other"
},
"target": {
"keyword": "enum",
"schemaPath": "/properties/mode/enum",
"instancePath": "/mode",
"property": null
},
"failures": [
{
"keyword": "enum",
"schemaPath": "/properties/mode/enum",
"instancePath": "/mode",
"property": null
}
],
"isolated": true,
"reason": null
},
{
"id": "extra",
"kind": "addProperty",
"status": "generated",
"value": {
"count": 1,
"mode": "fast",
"extra": null
},
"patch": {
"op": "add",
"path": "/extra",
"value": null
},
"target": {
"keyword": "additionalProperties",
"schemaPath": "/additionalProperties",
"instancePath": "",
"property": "extra"
},
"failures": [
{
"keyword": "additionalProperties",
"schemaPath": "/additionalProperties",
"instancePath": "",
"property": "extra"
}
],
"isolated": true,
"reason": null
}
],
"testing": {
"targetExecuted": false,
"behaviorVerified": false,
"fullInputSpaceCoverage": false
},
"metrics": {
"schemaNodes": 3,
"validatorNodeVisits": 17
}
},
"provenance": {
"inputSha256": "92b1781c5d4fb22662c0f3b12949608d22c2d3049848b4f4578d94b179aebd08",
"outputSha256": "c7d676c4af4f285bf4b45d99110910f7d394a6bdf6c8490543577d7cc0651ac9",
"deterministic": true,
"externalRequests": 0
}
}
Bounds and precision
JavaScript IEEE-754 numbers; use strings for large integer IDs/exact decimals where the schema accepts strings. No lossless numeric parsing.
{
"global": {
"requestBytes": 131072,
"responseBytes": 524288,
"jsonDepth": 32,
"jsonNodes": 20000,
"requestsPerMinute": 60,
"paidAttemptsPerMinute": 20,
"idempotencyHours": 24
},
"operation": {
"inputBytes": 100000,
"outputBytes": 300000,
"inputNodes": 12000,
"outputNodes": 50000,
"depth": 16,
"schemaNodes": 80,
"properties": 32,
"enumMembers": 16,
"arrayItems": 16,
"stringLength": 256,
"fixtures": 128,
"goals": 512,
"mutations": 64,
"validatorNodeVisits": 50000,
"candidateBytes": 2000000,
"jsonNodes": 12000,
"profile": "constructive-json-schema-v1"
}
}
Complete schemas, descriptions and cross-field validation may impose additional limits.
Proposed price and protocol definitions
{
"unit": "one successful operation call",
"proposedNominalUsd": "0.005",
"sixDecimalTokenBaseUnits": "5000",
"subscription": false,
"includesPayerWalletOrNetworkFees": false,
"liveQuoteVerified": false,
"condition": "Actual SDK challenge is authoritative only within the caller's explicit authorization; configured six-decimal token peg is an operator assertion, not a conversion guarantee."
}
Protocol definitions: x402, mpp. MPP uses Tempo charge. Paid MCP execution is unsupported. All runtime readiness is not evaluated in this build.
API path templates, not endpoints on this documentation host
{
"x402": "/v1/x402/json-contract-negative-cases",
"mpp": "/v1/mpp/json-contract-negative-cases"
}
Required headers
{
"Content-Type": "application/json",
"Idempotency-Key": "random 16–128 character operation identifier"
}
Actual SDK challenge amount, asset, network, recipient and wallet costs must pass independent authorization. Preserve identical key, body, protocol and credential on retries; on PAYMENT_UNCERTAIN stop and reconcile.
Execution profile and provider conditions
{
"deterministic": true,
"externalRequests": 0,
"maxExternalRequests": 0,
"resultSnapshotPersisted": false,
"fixedExampleIsIllustrativeSnapshot": false,
"requiresPayment": true,
"supportsMcpExecution": false
}
Deterministic supplied-input operation with no external requests or stored request/result bodies. Payment infrastructure retains payment metadata and hashes.
Failure handling
- HTTP 400: Malformed JSON, missing/invalid idempotency key, or payment identifier mismatch Correct the request before payment
- HTTP 402: Payment challenge or rejected payment Use official protocol SDK; inspect payment outcome before another payment
- HTTP 409: Idempotency conflict, duplicate proof, or PAYMENT_UNCERTAIN Keep original key, body, and proof; reconcile uncertainty with operator; never blindly repay
- HTTP 413: Input or generated output too large Reduce input; no payment attempted for validation failure
- HTTP 415: Unsupported media type or compression Send uncompressed application/json
- HTTP 422: Schema or service-specific semantic validation failure Correct input using returned error code; no payment attempted
- HTTP 429: Request/payment-attempt rate exceeded Wait for rate limit window; preserve existing payment identity
- HTTP 503: Payment configuration/provider/state unavailable, or live DNS preparation failed before settlement Check readiness; DNS preparation failures may retry the identical key/body/credential only; uncertainty requires reconciliation
Declared requirements
Before any paid call, refresh the live operation contract and POST the complete bounded budgeted plan to the separate API's /preflight. Unknown requirements block selection; compatible preflight is not permission to spend.