fix(sample-gen): xml attr with media-type example value (#7045)

This commit is contained in:
Mahtis Michel
2021-03-10 21:44:54 +01:00
committed by GitHub
parent 219d886265
commit 902241cf7e
2 changed files with 20 additions and 5 deletions

View File

@@ -1774,6 +1774,25 @@ describe("createXMLExample", function () {
expect(sut(definition, {}, expected)).toEqual(expected)
})
it("should use exampleOverride for attr too", () => {
let expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<aliens test=\"probe\">\n</aliens>"
let definition = {
type: "object",
properties: {
test: {
type: "string",
xml: {
attribute: true
}
}
},
xml: {
name: "aliens"
}
}
expect(sut(definition, {}, { test: "probe" })).toEqual(expected)
})
})
})