Error of xsd2jsonSchema function when processing xsd without complex types.
For example:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="TestElemet" type="SomeIdVariation48_Type"></xs:element>
<xs:simpleType name="SomeIdVariation48_Type">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{4}" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
Expected result:
{
"properties": {
"TestElemet": {
"pattern": "[0-9]{4}",
"type": "string"
}
},
"type": "object"
}
Actual result:
TypeError: Cannot read property 'forEach' of undefined
at getObjType (xsdlib\index.js:580:20)
at forEach (xsdlib\index.js:682:19)
at Array.forEach (<anonymous>)
at renderElements (xsdlib\index.js:668:16)
at simplifyJson (xsdlib\index.js:695:17)
at xsd2jsonSchema (xsdlib\index.js:879:15)
at Object.<anonymous> (xsdlib\__tests__\XsdTest.js:299:16)
at Object.asyncJestTest (xsdlib\node_modules\jest-jasmine2\build\jasmineAsyncInstall.js:106:37)
at xsdlib\node_modules\jest-jasmine2\build\queueRunner.js:45:12
at new Promise (<anonymous>)
at mapper (xsdlib\node_modules\jest-jasmine2\build\queueRunner.js:28:19)
at xsdlib\node_modules\jest-jasmine2\build\queueRunner.js:75:41
at xsd2jsonSchema (index.js:882:13)
Error of xsd2jsonSchema function when processing xsd without complex types.
For example:
Expected result:
{ "properties": { "TestElemet": { "pattern": "[0-9]{4}", "type": "string" } }, "type": "object" }Actual result: