{"openapi":"3.1.0","info":{"title":"Safe XML Parse and Canonicalize API","version":"1.0.0","description":"Inspect bounded XML for forbidden or reviewable constructs, parse it into a namespace-aware ordered tree, select nodes with a structured path, and create or compare deterministic canonical XML hashes. DTD and entity declarations are rejected, external resources are never resolved, payloads are not stored, and caller-supplied XPath is never executed. The API does not verify XML signatures or application-level semantics."},"paths":{"/marketplace/rapid/xml/v1/inspect":{"post":{"tags":["XML Safety Inspect"],"summary":"Inspect XML safety","description":"Detect forbidden DTD or entity declarations, malformed XML, processing instructions, XInclude elements, and bounded structural limits without resolving external resources.","operationId":"inspectXmlSafety","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLInspectRequest"},"examples":{"example":{"summary":"Inspect XML safety","value":{"xml":"<order><id>42</id><?route review?></order>"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLInspectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/rapid/xml/v1/parse":{"post":{"tags":["XML Ordered Tree Parse"],"summary":"Parse XML to an ordered tree","description":"Return a namespace-aware ordered XML tree that preserves attributes, text, child order, and mixed-content tails without claiming a universal object mapping.","operationId":"parseXmlToOrderedTree","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLParseRequest"},"examples":{"example":{"summary":"Parse XML to an ordered tree","value":{"xml":"<order currency=\"USD\"><line sku=\"A-1\">2</line><line sku=\"B-2\">1</line></order>"}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLParseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/rapid/xml/v1/select":{"post":{"tags":["XML Structured Select"],"summary":"Select XML nodes","description":"Select nodes with an exact structured root-to-child path using namespace URIs and optional one-based sibling positions; caller-supplied XPath is never executed.","operationId":"selectXmlNodes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLSelectRequest"},"examples":{"example":{"summary":"Select XML nodes","value":{"xml":"<order xmlns=\"urn:orders\"><line sku=\"A-1\">2</line><line sku=\"B-2\">1</line></order>","selector":[{"local_name":"order","namespace_uri":"urn:orders"},{"local_name":"line","namespace_uri":"urn:orders","position":2}],"max_matches":100}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLSelectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/rapid/xml/v1/canonicalize":{"post":{"tags":["XML Canonicalize"],"summary":"Canonicalize XML","description":"Create deterministic Python ElementTree C14N 2.0 output and a SHA-256 hash with explicit comment, whitespace, and prefix-rewrite options.","operationId":"canonicalizeXml","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLCanonicalizeRequest"},"examples":{"example":{"summary":"Canonicalize XML","value":{"xml":"<order b=\"2\" a=\"1\"><item> x </item></order>","with_comments":false,"strip_text":false,"rewrite_prefixes":true}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLCanonicalizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/rapid/xml/v1/compare":{"post":{"tags":["XML Canonical Compare"],"summary":"Compare canonical XML","description":"Canonicalize two bounded documents with identical options and report exact and canonical equality without claiming XML signature verification or application-level semantic equivalence.","operationId":"compareCanonicalXml","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLCompareRequest"},"examples":{"example":{"summary":"Compare canonical XML","value":{"left_xml":"<order a=\"1\" b=\"2\"><item>x</item></order>","right_xml":"<order b=\"2\" a=\"1\"><item>x</item></order>","with_comments":false,"strip_text":false,"rewrite_prefixes":true}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XMLCompareResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"XMLAttribute":{"properties":{"local_name":{"type":"string","title":"Local Name"},"namespace_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Namespace Uri"},"value":{"type":"string","title":"Value"}},"additionalProperties":false,"type":"object","required":["local_name","value"],"title":"XMLAttribute"},"XMLCanonicalizeRequest":{"properties":{"xml":{"type":"string","maxLength":262144,"minLength":1,"title":"Xml"},"with_comments":{"type":"boolean","title":"With Comments","default":false},"strip_text":{"type":"boolean","title":"Strip Text","default":false},"rewrite_prefixes":{"type":"boolean","title":"Rewrite Prefixes","default":true}},"additionalProperties":false,"type":"object","required":["xml"],"title":"XMLCanonicalizeRequest"},"XMLCanonicalizeResponse":{"properties":{"status":{"type":"string","const":"COMPLETED","title":"Status","default":"COMPLETED"},"decision":{"type":"string","enum":["CLEAR","REVIEW_REQUIRED"],"title":"Decision"},"source_sha256":{"type":"string","title":"Source Sha256"},"canonical_sha256":{"type":"string","title":"Canonical Sha256"},"canonical_xml":{"type":"string","title":"Canonical Xml"},"canonical_bytes":{"type":"integer","minimum":0.0,"title":"Canonical Bytes"},"source_changed":{"type":"boolean","title":"Source Changed"},"algorithm":{"type":"string","const":"PYTHON_ELEMENTTREE_C14N2","title":"Algorithm","default":"PYTHON_ELEMENTTREE_C14N2"},"options":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Options"},"stats":{"$ref":"#/components/schemas/XMLStats"},"ruleset_version":{"type":"string","title":"Ruleset Version","default":"2026-08-10"},"next_action":{"type":"string","title":"Next Action"}},"additionalProperties":false,"type":"object","required":["decision","source_sha256","canonical_sha256","canonical_xml","canonical_bytes","source_changed","options","stats","next_action"],"title":"XMLCanonicalizeResponse"},"XMLCompareRequest":{"properties":{"left_xml":{"type":"string","maxLength":262144,"minLength":1,"title":"Left Xml"},"right_xml":{"type":"string","maxLength":262144,"minLength":1,"title":"Right Xml"},"with_comments":{"type":"boolean","title":"With Comments","default":false},"strip_text":{"type":"boolean","title":"Strip Text","default":false},"rewrite_prefixes":{"type":"boolean","title":"Rewrite Prefixes","default":true}},"additionalProperties":false,"type":"object","required":["left_xml","right_xml"],"title":"XMLCompareRequest"},"XMLCompareResponse":{"properties":{"status":{"type":"string","const":"COMPLETED","title":"Status","default":"COMPLETED"},"decision":{"type":"string","enum":["CLEAR","REVIEW_REQUIRED"],"title":"Decision"},"exact_equal":{"type":"boolean","title":"Exact Equal"},"canonical_equal":{"type":"boolean","title":"Canonical Equal"},"left_source_sha256":{"type":"string","title":"Left Source Sha256"},"right_source_sha256":{"type":"string","title":"Right Source Sha256"},"left_canonical_sha256":{"type":"string","title":"Left Canonical Sha256"},"right_canonical_sha256":{"type":"string","title":"Right Canonical Sha256"},"algorithm":{"type":"string","const":"PYTHON_ELEMENTTREE_C14N2","title":"Algorithm","default":"PYTHON_ELEMENTTREE_C14N2"},"options":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Options"},"ruleset_version":{"type":"string","title":"Ruleset Version","default":"2026-08-10"},"next_action":{"type":"string","title":"Next Action"}},"additionalProperties":false,"type":"object","required":["decision","exact_equal","canonical_equal","left_source_sha256","right_source_sha256","left_canonical_sha256","right_canonical_sha256","options","next_action"],"title":"XMLCompareResponse"},"XMLFinding":{"properties":{"id":{"type":"string","title":"Id"},"signal":{"type":"string","enum":["DOCTYPE_DECLARATION","ENTITY_DECLARATION","PROCESSING_INSTRUCTION","XINCLUDE_ELEMENT","NOT_WELL_FORMED","STRUCTURE_LIMIT_EXCEEDED"],"title":"Signal"},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"title":"Severity"},"byte_start":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Byte Start"},"byte_end":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Byte End"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"},"evidence":{"additionalProperties":true,"type":"object","title":"Evidence"},"next_action":{"type":"string","title":"Next Action"}},"additionalProperties":false,"type":"object","required":["id","signal","severity","next_action"],"title":"XMLFinding"},"XMLInspectRequest":{"properties":{"xml":{"type":"string","maxLength":262144,"minLength":1,"title":"Xml"}},"additionalProperties":false,"type":"object","required":["xml"],"title":"XMLInspectRequest"},"XMLInspectResponse":{"properties":{"status":{"type":"string","const":"COMPLETED","title":"Status","default":"COMPLETED"},"decision":{"type":"string","enum":["CLEAR","REVIEW_REQUIRED","BLOCKED"],"title":"Decision"},"parsed":{"type":"boolean","title":"Parsed"},"well_formed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Well Formed"},"source_sha256":{"type":"string","title":"Source Sha256"},"finding_count":{"type":"integer","title":"Finding Count"},"counts_by_signal":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Signal"},"findings":{"items":{"$ref":"#/components/schemas/XMLFinding"},"type":"array","title":"Findings"},"issues":{"items":{"$ref":"#/components/schemas/XMLIssue"},"type":"array","title":"Issues"},"stats":{"anyOf":[{"$ref":"#/components/schemas/XMLStats"},{"type":"null"}]},"ruleset_version":{"type":"string","title":"Ruleset Version","default":"2026-08-10"},"external_resolution_performed":{"type":"boolean","const":false,"title":"External Resolution Performed","default":false},"next_action":{"type":"string","title":"Next Action"}},"additionalProperties":false,"type":"object","required":["decision","parsed","well_formed","source_sha256","finding_count","counts_by_signal","findings","issues","next_action"],"title":"XMLInspectResponse"},"XMLIssue":{"properties":{"code":{"type":"string","title":"Code"},"severity":{"type":"string","enum":["LOW","MEDIUM","HIGH"],"title":"Severity"},"message":{"type":"string","title":"Message"},"evidence":{"additionalProperties":true,"type":"object","title":"Evidence"},"next_action":{"type":"string","title":"Next Action"}},"additionalProperties":false,"type":"object","required":["code","severity","message","next_action"],"title":"XMLIssue"},"XMLMatch":{"properties":{"path":{"type":"string","title":"Path"},"document":{"$ref":"#/components/schemas/XMLNode"}},"additionalProperties":false,"type":"object","required":["path","document"],"title":"XMLMatch"},"XMLNode":{"properties":{"local_name":{"type":"string","title":"Local Name"},"namespace_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Namespace Uri"},"attributes":{"items":{"$ref":"#/components/schemas/XMLAttribute"},"type":"array","title":"Attributes"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"tail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tail"},"children":{"items":{"$ref":"#/components/schemas/XMLNode"},"type":"array","title":"Children"}},"additionalProperties":false,"type":"object","required":["local_name","attributes","children"],"title":"XMLNode"},"XMLParseRequest":{"properties":{"xml":{"type":"string","maxLength":262144,"minLength":1,"title":"Xml"}},"additionalProperties":false,"type":"object","required":["xml"],"title":"XMLParseRequest"},"XMLParseResponse":{"properties":{"status":{"type":"string","const":"COMPLETED","title":"Status","default":"COMPLETED"},"decision":{"type":"string","enum":["CLEAR","REVIEW_REQUIRED","BLOCKED"],"title":"Decision"},"source_sha256":{"type":"string","title":"Source Sha256"},"document":{"$ref":"#/components/schemas/XMLNode"},"stats":{"$ref":"#/components/schemas/XMLStats"},"findings":{"items":{"$ref":"#/components/schemas/XMLFinding"},"type":"array","title":"Findings"},"mapping":{"type":"string","const":"ORDERED_XML_TREE_V1","title":"Mapping","default":"ORDERED_XML_TREE_V1"},"ruleset_version":{"type":"string","title":"Ruleset Version","default":"2026-08-10"},"next_action":{"type":"string","title":"Next Action"}},"additionalProperties":false,"type":"object","required":["decision","source_sha256","document","stats","findings","next_action"],"title":"XMLParseResponse"},"XMLSelectRequest":{"properties":{"xml":{"type":"string","maxLength":262144,"minLength":1,"title":"Xml"},"selector":{"items":{"$ref":"#/components/schemas/XMLSelectorStep"},"type":"array","maxItems":32,"minItems":1,"title":"Selector"},"max_matches":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Max Matches","default":100}},"additionalProperties":false,"type":"object","required":["xml","selector"],"title":"XMLSelectRequest"},"XMLSelectResponse":{"properties":{"status":{"type":"string","const":"COMPLETED","title":"Status","default":"COMPLETED"},"decision":{"type":"string","enum":["CLEAR","REVIEW_REQUIRED","BLOCKED"],"title":"Decision"},"source_sha256":{"type":"string","title":"Source Sha256"},"matched_count":{"type":"integer","title":"Matched Count"},"matches_returned":{"type":"integer","title":"Matches Returned"},"matches_truncated":{"type":"boolean","title":"Matches Truncated"},"matches":{"items":{"$ref":"#/components/schemas/XMLMatch"},"type":"array","title":"Matches"},"selector_semantics":{"type":"string","const":"EXACT_ROOT_THEN_DIRECT_CHILDREN_V1","title":"Selector Semantics","default":"EXACT_ROOT_THEN_DIRECT_CHILDREN_V1"},"stats":{"$ref":"#/components/schemas/XMLStats"},"ruleset_version":{"type":"string","title":"Ruleset Version","default":"2026-08-10"},"next_action":{"type":"string","title":"Next Action"}},"additionalProperties":false,"type":"object","required":["decision","source_sha256","matched_count","matches_returned","matches_truncated","matches","stats","next_action"],"title":"XMLSelectResponse"},"XMLSelectorStep":{"properties":{"local_name":{"type":"string","maxLength":256,"minLength":1,"title":"Local Name"},"namespace_uri":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Namespace Uri"},"position":{"anyOf":[{"type":"integer","maximum":20000.0,"minimum":1.0},{"type":"null"}],"title":"Position"}},"additionalProperties":false,"type":"object","required":["local_name"],"title":"XMLSelectorStep"},"XMLStats":{"properties":{"element_count":{"type":"integer","minimum":1.0,"title":"Element Count"},"attribute_count":{"type":"integer","minimum":0.0,"title":"Attribute Count"},"maximum_depth":{"type":"integer","minimum":1.0,"title":"Maximum Depth"},"namespace_uris":{"items":{"type":"string"},"type":"array","title":"Namespace Uris"},"text_bytes":{"type":"integer","minimum":0.0,"title":"Text Bytes"}},"additionalProperties":false,"type":"object","required":["element_count","attribute_count","maximum_depth","namespace_uris","text_bytes"],"title":"XMLStats"}}},"tags":[{"name":"XML Safety Inspect","description":"A bounded, stateless XML safety and interoperability utility for agents, enterprise integrations, feeds, and workflow automation."},{"name":"XML Ordered Tree Parse","description":"A bounded, stateless XML safety and interoperability utility for agents, enterprise integrations, feeds, and workflow automation."},{"name":"XML Structured Select","description":"A bounded, stateless XML safety and interoperability utility for agents, enterprise integrations, feeds, and workflow automation."},{"name":"XML Canonicalize","description":"A bounded, stateless XML safety and interoperability utility for agents, enterprise integrations, feeds, and workflow automation."},{"name":"XML Canonical Compare","description":"A bounded, stateless XML safety and interoperability utility for agents, enterprise integrations, feeds, and workflow automation."}],"servers":[{"url":"https://api-production-9502.up.railway.app"}]}