AnsweredAssumed Answered

how do deal with apis with large numbers of array elements containing structures with variable arrays (of structures), with optional fields

Question asked by sdetweil2 on Jan 6, 2016
Latest reply on Jan 28, 2016 by Gaurav_Rana

I thought I had asked this question more  directly, but can't find it.. this applies to both REST/JSON and SOAP based protocols.


in many of our apis, there is an array of structures (think someones address).  the structures have optional fields (like second and third street address line).  the minimum fields are zip and countrycode.  but it could have 10 fields, or 2. or any combination.

the api supports 1 to 50 of these structures in the array.


in another part of a request, there is an array of requested shipping services, which have optional fields. so the structure is 4 fields at minimum and 8 maximum. no two array elements have to be the exact same layout.


on of the features of the apis is to 'validate/clense' addresses.. you didn't provide the street number, we find it and add it, of the 4 digit  zip extension, , or the city name, or... (so we want to use the data input as part/all of the output)


now to record or build a service from RR pairs,... but..  DT will flatten the structure to individual fields, with some naming convention based on the fields location in the structure in the array.


because the VSI matching will use all the field names (signature) and content (exact following field matching rules),  there must be a signature for each combination of fields possible for there to be coverage of all the possible message contents

(forget about matching the exact data, assume we use 'anything' for the match algorithm on fields, or just use signature).


because of the size of the data packet, the number of fields gets into the many hundreds quickly..


as these apis are under development, and structure changes are frequent, so this large text blob in the VSI for each transaction gets difficult to manage


how do we do this, without writing code?    (I can do my own match scripts, if I turn off all the fields in the vsi transaction), and I can write our own matching logic, and copy logic (which I have done for my rest/json simulator),


but the power of DT was that I didn't HAVE to write code to make this work..  I just haven't figured out how to do this