{"uid":"cap_qQ8juccbIyIwwBe0WnpCX","slug":"writerslogic-union-branch-classifier-e9a0b441","name":"WritersLogic Union Branch Classifier","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/union-branch?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"at":{"type":"string","maxLength":500,"description":"JSON pointer to the subschema holding the union (\"\" for the root, \"/properties/pet\" for a nested one)."},"value":{"description":"The JSON value to classify."},"schema":{"description":"The root schema; $ref targets are resolved inside it. Full JSON Schema 2020-12 (local $ref only)."},"keyword":{"enum":["oneOf","anyOf"],"type":"string","description":"Required only when the subschema has both."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_HXgrq1kwtjnE0Nt6CoUDQ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Evaluates a JSON value against every branch of a oneOf or anyOf schema and reports which branches match, fail (with exact JSON-pointer errors), the closest branch, and discriminator resolution.","exampleAgentPrompt":"My API keeps rejecting this payload with 'matches none of the oneOf branches' — can you evaluate this JSON value against the oneOf in my schema (at JSON pointer '/properties/pet') and tell me which branches match, which fail and why, and what the closest branch is?","exampleUseCases":[{"title":"Debug rejected OpenAPI discriminated union","prompt":"My OpenAPI endpoint is throwing a 'matches none of the oneOf' error for this payload. Can you run it against the oneOf at '/components/schemas/Animal' in my schema and tell me which branches fail, what the exact errors are for each, and which branch the discriminator points to?"},{"title":"Find why value matches multiple branches","prompt":"My schema validator says this JSON object matches more than one anyOf branch and I need to know which ones — can you evaluate it against the anyOf at the root of this schema and list every branch it satisfies?"},{"title":"Identify closest branch for partial payload","prompt":"This incomplete JSON payload doesn't match any branch of the oneOf in my schema at '/properties/event', but I want to know which branch it's closest to — can you check it and show me the exact JSON pointer errors for each failing branch?"}],"resultDescription":"A structured report listing: which oneOf/anyOf branches the value matches (by index or name), the validation errors (with JSON pointers to offending values) for each non-matching branch, the index of the closest branch (fewest or least severe errors), and if an OpenAPI discriminator is present, which branch it resolves to. Unsupported patterns (catastrophic-backtracking regex, unknown keywords) are flagged rather than silently treated as non-matches.","failureModes":["Schema contains remote $ref URLs — only local $refs are supported, remote references are reported as unsupported","Regex pattern in schema risks catastrophic backtracking — reported as unsupported, branch treated as non-match","Unknown JSON Schema keywords present — reported as unsupported rather than ignored","Subschema at the specified JSON pointer does not contain oneOf or anyOf — returns an error","Both oneOf and anyOf present in subschema but keyword parameter not supplied — ambiguity error returned","Malformed JSON pointer in 'at' field — returns pointer parse error","Value or schema fields missing or invalid JSON — returns 400-level error"],"whenToPreferThis":"Use this endpoint when an AI agent or developer needs to debug why a JSON payload is rejected by a oneOf or anyOf schema — especially when the error message is vague ('matches none' or 'matches more than one'). It is superior to generic JSON Schema validators because it evaluates every branch independently and surfaces branch-level errors with JSON pointers, identifies the closest branch, and resolves OpenAPI discriminators. Prefer it over manual inspection when schemas have three or more branches or when discriminator logic is involved.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:37:06.467Z","isFirstParty":false,"canonicalSlug":"writerslogic-union-branch-classifier-e9a0b441"}