Skip to content

Commit 65b3d5a

Browse files
committed
Use XMLParser API from fast-xml-parser 4.x
1 parent 14653ce commit 65b3d5a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/HttpProtocolTestGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ private String registerBodyComparatorStub(String mediaType) {
575575
case "application/xml":
576576
writer.addDependency(TypeScriptDependency.XML_PARSER);
577577
writer.addDependency(TypeScriptDependency.HTML_ENTITIES);
578-
writer.addImport("parse", "xmlParse", "fast-xml-parser");
578+
writer.addImport("XMLParser", null, "fast-xml-parser");
579579
writer.addImport("decodeHTML", "decodeHTML", "entities");
580580
additionalStubs.add("protocol-test-xml-stub.ts");
581581
return "compareEquivalentXmlBodies(bodyString, r.body.toString())";

smithy-typescript-codegen/src/main/resources/software/amazon/smithy/typescript/codegen/protocol-test-xml-stub.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const compareEquivalentXmlBodies = (
1616
};
1717

1818
const parseXmlBody = (body: string) => {
19-
const parsedObj = xmlParse(body, parseConfig);
19+
const parsedObj = new XMLParser(parseConfig).parse(body);
2020
const textNodeName = "#text";
2121
const key = Object.keys(parsedObj)[0];
2222
const parsedObjToReturn = parsedObj[key];

0 commit comments

Comments
 (0)