Loading utils/xml_to_json.py +23 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,12 @@ coerce_to_list = [ 'task:LDTaskFlag', 'task:TrafficPolicyReference', 'tp:TrafficRuleReference', 'tp:Criteria' 'tp:Criteria', 'common:DictionaryEntry', 'dictionaries:Dictionary', 'config:TargetFormatTypeDefinitionEntry', 'config:SupportedLIWorkflowEndpoint', 'config:SupportedLPWorkflowEndpoint', ] coerce_to_int = [ Loading @@ -81,6 +86,18 @@ coerce_to_bool = [ 'delivery:LastSequence' ] coerce_to_empty = [ 'CONFIG' ] coerce_null_to_empty = [ 'SupportedLIWorkflowEndpoints', 'SupportedLPWorkflowEndpoints', 'config:AssociatedLDRequestSubtypes', 'config:AssociatedLPRequestSubtypes', 'config:AssociatedLIRequestSubtypes', ] def postprocessor (path, key, value): if key == "@xsi:type": object_name = value.split(":")[-1] Loading @@ -91,6 +108,11 @@ def postprocessor (path, key, value): return key, int(value) if key in coerce_to_bool: return key, bool(value) if key in coerce_to_empty: return key, {} if key in coerce_null_to_empty: if value is None: return key, {} return key, value if __name__ == "__main__": Loading Loading
utils/xml_to_json.py +23 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,12 @@ coerce_to_list = [ 'task:LDTaskFlag', 'task:TrafficPolicyReference', 'tp:TrafficRuleReference', 'tp:Criteria' 'tp:Criteria', 'common:DictionaryEntry', 'dictionaries:Dictionary', 'config:TargetFormatTypeDefinitionEntry', 'config:SupportedLIWorkflowEndpoint', 'config:SupportedLPWorkflowEndpoint', ] coerce_to_int = [ Loading @@ -81,6 +86,18 @@ coerce_to_bool = [ 'delivery:LastSequence' ] coerce_to_empty = [ 'CONFIG' ] coerce_null_to_empty = [ 'SupportedLIWorkflowEndpoints', 'SupportedLPWorkflowEndpoints', 'config:AssociatedLDRequestSubtypes', 'config:AssociatedLPRequestSubtypes', 'config:AssociatedLIRequestSubtypes', ] def postprocessor (path, key, value): if key == "@xsi:type": object_name = value.split(":")[-1] Loading @@ -91,6 +108,11 @@ def postprocessor (path, key, value): return key, int(value) if key in coerce_to_bool: return key, bool(value) if key in coerce_to_empty: return key, {} if key in coerce_null_to_empty: if value is None: return key, {} return key, value if __name__ == "__main__": Loading