Migrate a v1 config to a v2 schema with an explicit mapping, and list what was dropped or defaulted
Applies a declared mapping (from pointer, to pointer, optional transform such as string-to-number or a value map) to a v1 JSON config, carries over unmapped keys the v2 schema declares, fills schema defaults, validates the result against the v2 JSON Schema 2020-12 and returns the migrated config plus three exact lists: dropped (v1 values that landed nowhere, with their JSON pointers), defaulted (values invented from schema defaults) and invalid (v2 schema errors with paths). For agents upgrading a user's config file or tool settings between versions without silently losing data. Conflicting mappings, overlapping sources and lossy transforms ("007", numbers beyond 2^53, arrays with more than one element) are failures, not guesses. It does not infer mappings; unmapped and undeclared keys are reported as dropped.
What you get
Data loss during config upgrades is silent. 100 mappings and a 15,000-node config per $0.005 call.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/config-migration. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/config-migration \
-H 'content-type: application/json' \
-d '{"v1":{"server":{"host":"db1","port":"5432","legacy_ssl":true},"debug":"yes","name":"x"},"v2Schema":{"type":"object","required":["database"],"additionalProperties":false,"properties":{"name":{"type":"string"},"database":{"type":"object","required":["host","port"],"properties":{"host":{"type":"string"},"port":{"type":"integer"},"timeoutMs":{"type":"integer","default":3000}}}}},"mapping":[{"from":"/server/host","to":"/database/host"},{"from":"/server/port","to":"/database/port","transform":"string-to-number"}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
v1 | any | yes | The old config (any JSON value). |
v2Schema | any | yes | The new config's schema. Full JSON Schema 2020-12 (local $ref only). |
mapping | array<object>; max 100 items | yes | |
carryDeclared | boolean | no | Copy unmapped v1 values to the same pointer when v2 declares that property (default true). |
applyDefaults | boolean | no | Fill missing v2 properties from schema defaults (default true). |
Example request body
{
"v1": {
"server": {
"host": "db1",
"port": "5432",
"legacy_ssl": true
},
"debug": "yes",
"name": "x"
},
"v2Schema": {
"type": "object",
"required": [
"database"
],
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"database": {
"type": "object",
"required": [
"host",
"port"
],
"properties": {
"host": {
"type": "string"
},
"port": {
"type": "integer"
},
"timeoutMs": {
"type": "integer",
"default": 3000
}
}
}
}
},
"mapping": [
{
"from": "/server/host",
"to": "/database/host"
},
{
"from": "/server/port",
"to": "/database/port",
"transform": "string-to-number"
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
migrated | any | no | The v2 config. |
applied | array<object> | no | |
carried | array<string> | no | v1 pointers copied unchanged because v2 declares the same pointer. |
dropped | array<object> | no | |
acknowledgedDrops | array<string> | no | |
defaulted | array<object> | no | |
unusedMappings | array<string> | no | Mapping sources that do not exist in v1. |
invalid | array<object> | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the data-contract-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent