mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-21 10:54:08 +02:00
Qualify namespaced OpenAPI XML attributes (#598)
This commit is contained in:
@@ -1043,6 +1043,31 @@ describe("importer-openapi", () => {
|
||||
example: "42",
|
||||
xml: { attribute: true, namespace: "urn:metadata", prefix: "m" },
|
||||
},
|
||||
externalId: {
|
||||
type: "string",
|
||||
example: "external",
|
||||
xml: {
|
||||
attribute: true,
|
||||
name: "external-id",
|
||||
namespace: "urn:external",
|
||||
prefix: "ns1",
|
||||
},
|
||||
},
|
||||
tenant: {
|
||||
type: "string",
|
||||
example: "acme",
|
||||
xml: { attribute: true, namespace: "urn:tenant" },
|
||||
},
|
||||
region: {
|
||||
type: "string",
|
||||
example: "west",
|
||||
xml: { attribute: true, namespace: "urn:tenant" },
|
||||
},
|
||||
legacy: {
|
||||
type: "string",
|
||||
example: "plain",
|
||||
xml: { attribute: true, namespace: "", prefix: "unbound" },
|
||||
},
|
||||
tags: {
|
||||
type: "array",
|
||||
example: ["one", "two"],
|
||||
@@ -1094,7 +1119,10 @@ describe("importer-openapi", () => {
|
||||
|
||||
expect(imported?.resources.httpRequests[0]?.body).toEqual({
|
||||
text:
|
||||
'<c:catalog xmlns:c="urn:catalog" xmlns:m="urn:metadata" m:id="42">' +
|
||||
'<c:catalog xmlns:c="urn:catalog" xmlns:m="urn:metadata" ' +
|
||||
'xmlns:ns1="urn:external" xmlns:ns2="urn:tenant" ' +
|
||||
'm:id="42" ns1:external-id="external" ns2:tenant="acme" ns2:region="west" ' +
|
||||
'legacy="plain">' +
|
||||
'<t:tags xmlns:t="urn:tags"><tag>one</tag><tag>two</tag></t:tags>' +
|
||||
'<a:alias xmlns:a="urn:aliases">Ada</a:alias>' +
|
||||
'<a:alias xmlns:a="urn:aliases">A</a:alias>' +
|
||||
|
||||
Reference in New Issue
Block a user