Primary

It provides the path details of the primary key(s).

Possible Locations

Attributes


Name Type Description
path
required
String Data path of the primary key, relative to the path mentioned in the data-extraction-path.
name String Name of the primary key. It helps in mapping the primary key values in different keys within the resource.

Info:
  • The primary keys are collected in the form of data path to precisely locate them in the primary structure, as they can be anywhere in that <structure>.
  • By default, the name of the primary key is taken from the last property of the path value.

Example

Consider that you want to use the trip_id and trip_name keys from the following structure as primary keys for the trips resource.

    
copy
<components> <!-- primary structure of the trips resource --> <structure ref-name="trips" name="primary_structure"> <property name="trip_name" type="string"/> <property name="trip_id" type="long_string"/> <property name="destination" type="string"/> <property name="start_time" type="datetime"/> <property name="end_time" type="datetime"/> <property name="no_of_days" type="string"/> </structure> <!-- wrapper of the primary structure --> <structure ref-name="data" name="wrapper"> <property name="trips" type="collections"> <structure-ref name="trips" /> </property> </structure> </components>

Here is how you have to write the primary for this resource.

    
copy
<path-config data-extraction-path="$.trips"> <primary path="$.trip_id" /> <primary path="$.trip_name" /> </path-config>

Last Updated 2025-05-30 16:54:59 +0530 +0530