fix(openapi): wrap root XML arrays

This commit is contained in:
Gregory Schier
2026-08-19 13:32:09 -07:00
parent e2da700aaa
commit 509fb3c63f
2 changed files with 25 additions and 5 deletions
@@ -1071,6 +1071,23 @@ describe("importer-openapi", () => {
responses: {},
},
},
"/values": {
post: {
requestBody: {
content: {
"application/xml": {
schema: {
type: "array",
example: ["one", "two"],
xml: { name: "values", wrapped: false },
items: { type: "string", xml: { name: "value" } },
},
},
},
},
responses: {},
},
},
},
}),
);
@@ -1083,6 +1100,9 @@ describe("importer-openapi", () => {
'<a:alias xmlns:a="urn:aliases">A</a:alias>' +
"</c:catalog>",
});
expect(imported?.resources.httpRequests[1]?.body).toEqual({
text: "<values><value>one</value><value>two</value></values>",
});
});
test("Omits read-only properties from generated request bodies", async () => {