Commit 8d9d6dde authored by Mark Canterbury's avatar Mark Canterbury
Browse files

Updating XSD to include JSON data elements

parent 13c98733
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
                  }
                },
                "delivery:Delivery": {
                  "delivery:EmbeddedJSONData": {
                  "delivery:JSONData": {
                    "field1" : "this is native JSON embedded data",
                    "field2" : 1234
                  }
+24 −1
Original line number Diff line number Diff line
@@ -145,6 +145,17 @@
          "required": [
            "delivery:XMLSchema"
          ]
        },
        {
          "type": "object",
          "properties": {
            "delivery:JSONSchema": {
              "$ref": "#/$defs/EmbeddedJSONData"
            }
          },
          "required": [
            "delivery:JSONSchema"
          ]
        }
      ]
    },
@@ -180,6 +191,17 @@
          "required": [
            "delivery:XMLData"
          ]
        },
        {
          "type": "object",
          "properties": {
            "delivery:JSONData": {
              "$ref": "#/$defs/EmbeddedJSONData"
            }
          },
          "required": [
            "delivery:JSONData"
          ]
        }
      ]
    },
@@ -204,6 +226,7 @@
        "delivery:Data"
      ]
    },
    "EmbeddedXMLData": {}
    "EmbeddedXMLData": {},
    "EmbeddedJSONData": {}
  }
}
 No newline at end of file
+7 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
        <xs:choice>
            <xs:element name="BinaryData" type="EmbeddedBinaryData"/>
            <xs:element name="XMLSchema" type="SchemaContent"/>
            <xs:element name="JSONSchema" type="EmbeddedJSONData"/>
        </xs:choice>
    </xs:complexType>
    <xs:complexType name="SchemaContent">
@@ -50,6 +51,7 @@
        <xs:choice>
            <xs:element name="BinaryData" type="EmbeddedBinaryData"/>
            <xs:element name="XMLData" type="EmbeddedXMLData"/>
            <xs:element name="JSONData" type="EmbeddedJSONData"/>
        </xs:choice>
    </xs:complexType>
    <xs:complexType name="EmbeddedBinaryData">
@@ -65,4 +67,9 @@
            <xs:any namespace="##other" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="EmbeddedJSONData">
        <xs:sequence>
            <xs:any namespace="##other" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>
+6 −3
Original line number Diff line number Diff line
@@ -70,10 +70,13 @@ if __name__ == "__main__":
    json_schemas = {}
    for schema_tuple in schema_locations:
        logging.info(f"  Translating {schema_tuple}")
        if 'xmldsig' in (schema_tuple[1]):
            # TODO - work out what to do here
            logging.info("  Skipping XML Dsig...")
        if ns_map[schema_tuple[0]].get('skip'):
            logging.info(f"  Skipping {schema_tuple[0]} due to config...")
            continue
        # if 'xmldsig' in (schema_tuple[1]):
        #     # TODO - work out what to do here
        #     logging.info("  Skipping XML Dsig...")
        #     continue
        js = translate_schema(schema_tuple[1], ns_map, schema_locations)

        # TODO - Special case, get rid of signature