ondc-code-generator 0.8.3 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -176,73 +176,73 @@
176
176
  "$.message.catalog['bpp/fulfillments'][*].contact.phone",
177
177
  "$.message.catalog['bpp/fulfillments'][*].contact.email"
178
178
  ],
179
- "item": [
180
- "$.items[*].id",
181
- "$.items[*].parent_item_id",
182
- "$.items[*].descriptor.name",
183
- "$.items[*].descriptor.code",
184
- "$.items[*].descriptor.symbol",
185
- "$.items[*].descriptor.short_desc",
186
- "$.items[*].descriptor.long_desc",
187
- "$.items[*].descriptor.images[*]",
188
- "$.items[*].descriptor.tags[*].code",
189
- "$.items[*].descriptor.tags[*].list[*].code",
190
- "$.items[*].descriptor.tags[*].list[*].name",
191
- "$.items[*].descriptor.tags[*].list[*].value",
192
- "$.items[*].descriptor.additional_desc.content_type",
193
- "$.items[*].price.currency",
194
- "$.items[*].price.value",
195
- "$.items[*].price.maximum_value",
196
- "$.items[*].price.tags[*].code",
197
- "$.items[*].price.tags[*].list[*].code",
198
- "$.items[*].price.tags[*].list[*].name",
199
- "$.items[*].price.tags[*].list[*].value",
200
- "$.items[*].quantity.available.count",
201
- "$.items[*].quantity.maximum.count",
202
- "$.items[*].quantity.unitized.count",
203
- "$.items[*].quantity.unitized.measure.unit",
204
- "$.items[*].quantity.unitized.measure.value",
205
- "$.items[*].quantity.count",
206
- "$.items[*].category_id",
207
- "$.items[*].category_ids[*]",
208
- "$.items[*].fulfillment_id",
209
- "$.items[*].fulfillment_ids[*]",
210
- "$.items[*].replacement_terms[*].replace_within.duration",
211
- "$.items[*].rating",
212
- "$.items[*].location_id",
213
- "$.items[*].time.label",
214
- "$.items[*].time.timestamp",
215
- "$.items[*].time.range.start",
216
- "$.items[*].time.range.end",
217
- "$.items[*].time.days",
218
- "$.items[*].time.schedule.frequency",
219
- "$.items[*].time.schedule.holidays[*]",
220
- "$.items[*].time.schedule.times[*]",
221
- "$.items[*].related",
222
- "$.items[*].recommended",
223
- "$.items[*]['@ondc/org/returnable']",
224
- "$.items[*]['@ondc/org/seller_pickup_return']",
225
- "$.items[*]['@ondc/org/return_window']",
226
- "$.items[*]['@ondc/org/cancellable']",
227
- "$.items[*]['@ondc/org/time_to_ship']",
228
- "$.items[*]['@ondc/org/available_on_cod']",
229
- "$.items[*]['@ondc/org/contact_details_consumer_care']",
230
- "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].common_or_generic_name_of_commodity",
231
- "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].month_year_of_manufacture_packing_import",
232
- "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].manufacturer_or_packer_name",
233
- "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].manufacturer_or_packer_address",
234
- "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].mfg_license_no",
235
- "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].multiple_products_name_number_or_qty",
236
- "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].net_quantity_or_measure_of_commodity_in_pkg",
237
- "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].expiry_date",
238
- "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].nutritional_info",
239
- "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].additives_info",
240
- "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].brand_owner_FSSAI_license_no",
241
- "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].other_FSSAI_license_no",
242
- "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].importer_FSSAI_license_no",
243
- "$.items[*].tags[*].code",
244
- "$.items[*].tags[*].list[*].code",
245
- "$.items[*].tags[*].list[*].name",
246
- "$.items[*].tags[*].list[*].value"
179
+ "items": [
180
+ "$.id",
181
+ "$.parent_item_id",
182
+ "$.descriptor.name",
183
+ "$.descriptor.code",
184
+ "$.descriptor.symbol",
185
+ "$.descriptor.short_desc",
186
+ "$.descriptor.long_desc",
187
+ "$.descriptor.images[*]",
188
+ "$.descriptor.tags[*].code",
189
+ "$.descriptor.tags[*].list[*].code",
190
+ "$.descriptor.tags[*].list[*].name",
191
+ "$.descriptor.tags[*].list[*].value",
192
+ "$.descriptor.additional_desc.content_type",
193
+ "$.price.currency",
194
+ "$.price.value",
195
+ "$.price.maximum_value",
196
+ "$.price.tags[*].code",
197
+ "$.price.tags[*].list[*].code",
198
+ "$.price.tags[*].list[*].name",
199
+ "$.price.tags[*].list[*].value",
200
+ "$.quantity.available.count",
201
+ "$.quantity.maximum.count",
202
+ "$.quantity.unitized.count",
203
+ "$.quantity.unitized.measure.unit",
204
+ "$.quantity.unitized.measure.value",
205
+ "$.quantity.count",
206
+ "$.category_id",
207
+ "$.category_ids[*]",
208
+ "$.fulfillment_id",
209
+ "$.fulfillment_ids[*]",
210
+ "$.replacement_terms[*].replace_within.duration",
211
+ "$.rating",
212
+ "$.location_id",
213
+ "$.time.label",
214
+ "$.time.timestamp",
215
+ "$.time.range.start",
216
+ "$.time.range.end",
217
+ "$.time.days",
218
+ "$.time.schedule.frequency",
219
+ "$.time.schedule.holidays[*]",
220
+ "$.time.schedule.times[*]",
221
+ "$.related",
222
+ "$.recommended",
223
+ "$['@ondc/org/returnable']",
224
+ "$['@ondc/org/seller_pickup_return']",
225
+ "$['@ondc/org/return_window']",
226
+ "$['@ondc/org/cancellable']",
227
+ "$['@ondc/org/time_to_ship']",
228
+ "$['@ondc/org/available_on_cod']",
229
+ "$['@ondc/org/contact_details_consumer_care']",
230
+ "$['@ondc/org/statutory_reqs_packaged_commodities'].common_or_generic_name_of_commodity",
231
+ "$['@ondc/org/statutory_reqs_packaged_commodities'].month_year_of_manufacture_packing_import",
232
+ "$['@ondc/org/statutory_reqs_packaged_commodities'].manufacturer_or_packer_name",
233
+ "$['@ondc/org/statutory_reqs_packaged_commodities'].manufacturer_or_packer_address",
234
+ "$['@ondc/org/statutory_reqs_packaged_commodities'].mfg_license_no",
235
+ "$['@ondc/org/statutory_reqs_packaged_commodities'].multiple_products_name_number_or_qty",
236
+ "$['@ondc/org/statutory_reqs_packaged_commodities'].net_quantity_or_measure_of_commodity_in_pkg",
237
+ "$['@ondc/org/statutory_reqs_packaged_commodities'].expiry_date",
238
+ "$['@ondc/org/statutory_reqs_prepackaged_food'].nutritional_info",
239
+ "$['@ondc/org/statutory_reqs_prepackaged_food'].additives_info",
240
+ "$['@ondc/org/statutory_reqs_prepackaged_food'].brand_owner_FSSAI_license_no",
241
+ "$['@ondc/org/statutory_reqs_prepackaged_food'].other_FSSAI_license_no",
242
+ "$['@ondc/org/statutory_reqs_prepackaged_food'].importer_FSSAI_license_no",
243
+ "$.tags[*].code",
244
+ "$.tags[*].list[*].code",
245
+ "$.tags[*].list[*].name",
246
+ "$.tags[*].list[*].value"
247
247
  ]
248
248
  }
@@ -0,0 +1,248 @@
1
+ {
2
+ "paths": [],
3
+ "provider": [
4
+ "$.context.domain",
5
+ "$.context.country",
6
+ "$.context.city",
7
+ "$.context.action",
8
+ "$.context.core_version",
9
+ "$.context.bap_id",
10
+ "$.context.bap_uri",
11
+ "$.context.bpp_id",
12
+ "$.context.bpp_uri",
13
+ "$.context.transaction_id",
14
+ "$.context.message_id",
15
+ "$.context.timestamp",
16
+ "$.context.key",
17
+ "$.context.ttl",
18
+ "$.message.catalog['bpp/descriptor'].name",
19
+ "$.message.catalog['bpp/descriptor'].code",
20
+ "$.message.catalog['bpp/descriptor'].symbol",
21
+ "$.message.catalog['bpp/descriptor'].short_desc",
22
+ "$.message.catalog['bpp/descriptor'].long_desc",
23
+ "$.message.catalog['bpp/descriptor'].images[*]",
24
+ "$.message.catalog['bpp/descriptor'].tags[*].code",
25
+ "$.message.catalog['bpp/descriptor'].tags[*].list[*].code",
26
+ "$.message.catalog['bpp/descriptor'].tags[*].list[*].name",
27
+ "$.message.catalog['bpp/descriptor'].tags[*].list[*].value",
28
+ "$.message.catalog['bpp/descriptor'].additional_desc.content_type",
29
+ "$.message.catalog['bpp/providers'][*].id",
30
+ "$.message.catalog['bpp/providers'][*].descriptor.name",
31
+ "$.message.catalog['bpp/providers'][*].descriptor.code",
32
+ "$.message.catalog['bpp/providers'][*].descriptor.symbol",
33
+ "$.message.catalog['bpp/providers'][*].descriptor.short_desc",
34
+ "$.message.catalog['bpp/providers'][*].descriptor.long_desc",
35
+ "$.message.catalog['bpp/providers'][*].descriptor.images[*]",
36
+ "$.message.catalog['bpp/providers'][*].descriptor.tags[*].code",
37
+ "$.message.catalog['bpp/providers'][*].descriptor.tags[*].list[*].code",
38
+ "$.message.catalog['bpp/providers'][*].descriptor.tags[*].list[*].name",
39
+ "$.message.catalog['bpp/providers'][*].descriptor.tags[*].list[*].value",
40
+ "$.message.catalog['bpp/providers'][*].descriptor.additional_desc.content_type",
41
+ "$.message.catalog['bpp/providers'][*].category_id",
42
+ "$.message.catalog['bpp/providers'][*]['@ondc/org/fssai_license_no']",
43
+ "$.message.catalog['bpp/providers'][*].rating",
44
+ "$.message.catalog['bpp/providers'][*].time.label",
45
+ "$.message.catalog['bpp/providers'][*].time.timestamp",
46
+ "$.message.catalog['bpp/providers'][*].time.range.start",
47
+ "$.message.catalog['bpp/providers'][*].time.range.end",
48
+ "$.message.catalog['bpp/providers'][*].time.days",
49
+ "$.message.catalog['bpp/providers'][*].time.schedule.frequency",
50
+ "$.message.catalog['bpp/providers'][*].time.schedule.holidays[*]",
51
+ "$.message.catalog['bpp/providers'][*].time.schedule.times[*]",
52
+ "$.message.catalog['bpp/providers'][*].categories[*].id",
53
+ "$.message.catalog['bpp/providers'][*].categories[*].parent_category_id",
54
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.name",
55
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.code",
56
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.symbol",
57
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.short_desc",
58
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.long_desc",
59
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.images[*]",
60
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.tags[*].code",
61
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.tags[*].list[*].code",
62
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.tags[*].list[*].name",
63
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.tags[*].list[*].value",
64
+ "$.message.catalog['bpp/providers'][*].categories[*].descriptor.additional_desc.content_type",
65
+ "$.message.catalog['bpp/providers'][*].categories[*].time.label",
66
+ "$.message.catalog['bpp/providers'][*].categories[*].time.timestamp",
67
+ "$.message.catalog['bpp/providers'][*].categories[*].time.range.start",
68
+ "$.message.catalog['bpp/providers'][*].categories[*].time.range.end",
69
+ "$.message.catalog['bpp/providers'][*].categories[*].time.days",
70
+ "$.message.catalog['bpp/providers'][*].categories[*].time.schedule.frequency",
71
+ "$.message.catalog['bpp/providers'][*].categories[*].time.schedule.holidays[*]",
72
+ "$.message.catalog['bpp/providers'][*].categories[*].time.schedule.times[*]",
73
+ "$.message.catalog['bpp/providers'][*].categories[*].image",
74
+ "$.message.catalog['bpp/providers'][*].categories[*].tags[*].code",
75
+ "$.message.catalog['bpp/providers'][*].categories[*].tags[*].list[*].code",
76
+ "$.message.catalog['bpp/providers'][*].categories[*].tags[*].list[*].name",
77
+ "$.message.catalog['bpp/providers'][*].categories[*].tags[*].list[*].value",
78
+ "$.message.catalog['bpp/providers'][*].creds[*].id",
79
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.name",
80
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.code",
81
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.symbol",
82
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.short_desc",
83
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.long_desc",
84
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.images[*]",
85
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.tags[*].code",
86
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.tags[*].list[*].code",
87
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.tags[*].list[*].name",
88
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.tags[*].list[*].value",
89
+ "$.message.catalog['bpp/providers'][*].creds[*].descriptor.additional_desc.content_type",
90
+ "$.message.catalog['bpp/providers'][*].creds[*].url",
91
+ "$.message.catalog['bpp/providers'][*].creds[*].tags.code",
92
+ "$.message.catalog['bpp/providers'][*].creds[*].tags.list[*].code",
93
+ "$.message.catalog['bpp/providers'][*].creds[*].tags.list[*].name",
94
+ "$.message.catalog['bpp/providers'][*].creds[*].tags.list[*].value",
95
+ "$.message.catalog['bpp/providers'][*].fulfillments[*].id",
96
+ "$.message.catalog['bpp/providers'][*].fulfillments[*].type",
97
+ "$.message.catalog['bpp/providers'][*].fulfillments[*].contact.name",
98
+ "$.message.catalog['bpp/providers'][*].fulfillments[*].contact.phone",
99
+ "$.message.catalog['bpp/providers'][*].fulfillments[*].contact.email",
100
+ "$.message.catalog['bpp/providers'][*].locations[*].id",
101
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.name",
102
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.code",
103
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.symbol",
104
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.short_desc",
105
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.long_desc",
106
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.images[*]",
107
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.tags[*].code",
108
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.tags[*].list[*].code",
109
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.tags[*].list[*].name",
110
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.tags[*].list[*].value",
111
+ "$.message.catalog['bpp/providers'][*].locations[*].descriptor.additional_desc.content_type",
112
+ "$.message.catalog['bpp/providers'][*].locations[*].gps",
113
+ "$.message.catalog['bpp/providers'][*].locations[*].address.name",
114
+ "$.message.catalog['bpp/providers'][*].locations[*].address.building",
115
+ "$.message.catalog['bpp/providers'][*].locations[*].address.street",
116
+ "$.message.catalog['bpp/providers'][*].locations[*].address.locality",
117
+ "$.message.catalog['bpp/providers'][*].locations[*].address.city",
118
+ "$.message.catalog['bpp/providers'][*].locations[*].address.state",
119
+ "$.message.catalog['bpp/providers'][*].locations[*].address.country",
120
+ "$.message.catalog['bpp/providers'][*].locations[*].address.area_code",
121
+ "$.message.catalog['bpp/providers'][*].locations[*].city.name",
122
+ "$.message.catalog['bpp/providers'][*].locations[*].city.code",
123
+ "$.message.catalog['bpp/providers'][*].locations[*].state.name",
124
+ "$.message.catalog['bpp/providers'][*].locations[*].state.code",
125
+ "$.message.catalog['bpp/providers'][*].locations[*].time.label",
126
+ "$.message.catalog['bpp/providers'][*].locations[*].time.timestamp",
127
+ "$.message.catalog['bpp/providers'][*].locations[*].time.range.start",
128
+ "$.message.catalog['bpp/providers'][*].locations[*].time.range.end",
129
+ "$.message.catalog['bpp/providers'][*].locations[*].time.days",
130
+ "$.message.catalog['bpp/providers'][*].locations[*].time.schedule.frequency",
131
+ "$.message.catalog['bpp/providers'][*].locations[*].time.schedule.holidays[*]",
132
+ "$.message.catalog['bpp/providers'][*].locations[*].time.schedule.times[*]",
133
+ "$.message.catalog['bpp/providers'][*].locations[*].circle.gps",
134
+ "$.message.catalog['bpp/providers'][*].locations[*].circle.radius.type",
135
+ "$.message.catalog['bpp/providers'][*].locations[*].circle.radius.value",
136
+ "$.message.catalog['bpp/providers'][*].locations[*].circle.radius.estimated_value",
137
+ "$.message.catalog['bpp/providers'][*].locations[*].circle.radius.computed_value",
138
+ "$.message.catalog['bpp/providers'][*].locations[*].circle.radius.range.min",
139
+ "$.message.catalog['bpp/providers'][*].locations[*].circle.radius.range.max",
140
+ "$.message.catalog['bpp/providers'][*].locations[*].circle.radius.unit",
141
+ "$.message.catalog['bpp/providers'][*].offers[*].id",
142
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.name",
143
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.code",
144
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.symbol",
145
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.short_desc",
146
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.long_desc",
147
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.images[*]",
148
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.tags[*].code",
149
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.tags[*].list[*].code",
150
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.tags[*].list[*].name",
151
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.tags[*].list[*].value",
152
+ "$.message.catalog['bpp/providers'][*].offers[*].descriptor.additional_desc.content_type",
153
+ "$.message.catalog['bpp/providers'][*].offers[*].location_ids[*]",
154
+ "$.message.catalog['bpp/providers'][*].offers[*].category_ids[*]",
155
+ "$.message.catalog['bpp/providers'][*].offers[*].item_ids[*]",
156
+ "$.message.catalog['bpp/providers'][*].offers[*].time.label",
157
+ "$.message.catalog['bpp/providers'][*].offers[*].time.timestamp",
158
+ "$.message.catalog['bpp/providers'][*].offers[*].time.range.start",
159
+ "$.message.catalog['bpp/providers'][*].offers[*].time.range.end",
160
+ "$.message.catalog['bpp/providers'][*].offers[*].time.days",
161
+ "$.message.catalog['bpp/providers'][*].offers[*].time.schedule.frequency",
162
+ "$.message.catalog['bpp/providers'][*].offers[*].time.schedule.holidays[*]",
163
+ "$.message.catalog['bpp/providers'][*].offers[*].time.schedule.times[*]",
164
+ "$.message.catalog['bpp/providers'][*].offers[*].tags[*].code",
165
+ "$.message.catalog['bpp/providers'][*].offers[*].tags[*].list[*].code",
166
+ "$.message.catalog['bpp/providers'][*].offers[*].tags[*].list[*].name",
167
+ "$.message.catalog['bpp/providers'][*].offers[*].tags[*].list[*].value",
168
+ "$.message.catalog['bpp/providers'][*].ttl",
169
+ "$.message.catalog['bpp/providers'][*].tags[*].code",
170
+ "$.message.catalog['bpp/providers'][*].tags[*].list[*].code",
171
+ "$.message.catalog['bpp/providers'][*].tags[*].list[*].name",
172
+ "$.message.catalog['bpp/providers'][*].tags[*].list[*].value",
173
+ "$.message.catalog['bpp/fulfillments'][*].id",
174
+ "$.message.catalog['bpp/fulfillments'][*].type",
175
+ "$.message.catalog['bpp/fulfillments'][*].contact.name",
176
+ "$.message.catalog['bpp/fulfillments'][*].contact.phone",
177
+ "$.message.catalog['bpp/fulfillments'][*].contact.email"
178
+ ],
179
+ "item": [
180
+ "$.items[*].id",
181
+ "$.items[*].parent_item_id",
182
+ "$.items[*].descriptor.name",
183
+ "$.items[*].descriptor.code",
184
+ "$.items[*].descriptor.symbol",
185
+ "$.items[*].descriptor.short_desc",
186
+ "$.items[*].descriptor.long_desc",
187
+ "$.items[*].descriptor.images[*]",
188
+ "$.items[*].descriptor.tags[*].code",
189
+ "$.items[*].descriptor.tags[*].list[*].code",
190
+ "$.items[*].descriptor.tags[*].list[*].name",
191
+ "$.items[*].descriptor.tags[*].list[*].value",
192
+ "$.items[*].descriptor.additional_desc.content_type",
193
+ "$.items[*].price.currency",
194
+ "$.items[*].price.value",
195
+ "$.items[*].price.maximum_value",
196
+ "$.items[*].price.tags[*].code",
197
+ "$.items[*].price.tags[*].list[*].code",
198
+ "$.items[*].price.tags[*].list[*].name",
199
+ "$.items[*].price.tags[*].list[*].value",
200
+ "$.items[*].quantity.available.count",
201
+ "$.items[*].quantity.maximum.count",
202
+ "$.items[*].quantity.unitized.count",
203
+ "$.items[*].quantity.unitized.measure.unit",
204
+ "$.items[*].quantity.unitized.measure.value",
205
+ "$.items[*].quantity.count",
206
+ "$.items[*].category_id",
207
+ "$.items[*].category_ids[*]",
208
+ "$.items[*].fulfillment_id",
209
+ "$.items[*].fulfillment_ids[*]",
210
+ "$.items[*].replacement_terms[*].replace_within.duration",
211
+ "$.items[*].rating",
212
+ "$.items[*].location_id",
213
+ "$.items[*].time.label",
214
+ "$.items[*].time.timestamp",
215
+ "$.items[*].time.range.start",
216
+ "$.items[*].time.range.end",
217
+ "$.items[*].time.days",
218
+ "$.items[*].time.schedule.frequency",
219
+ "$.items[*].time.schedule.holidays[*]",
220
+ "$.items[*].time.schedule.times[*]",
221
+ "$.items[*].related",
222
+ "$.items[*].recommended",
223
+ "$.items[*]['@ondc/org/returnable']",
224
+ "$.items[*]['@ondc/org/seller_pickup_return']",
225
+ "$.items[*]['@ondc/org/return_window']",
226
+ "$.items[*]['@ondc/org/cancellable']",
227
+ "$.items[*]['@ondc/org/time_to_ship']",
228
+ "$.items[*]['@ondc/org/available_on_cod']",
229
+ "$.items[*]['@ondc/org/contact_details_consumer_care']",
230
+ "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].common_or_generic_name_of_commodity",
231
+ "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].month_year_of_manufacture_packing_import",
232
+ "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].manufacturer_or_packer_name",
233
+ "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].manufacturer_or_packer_address",
234
+ "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].mfg_license_no",
235
+ "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].multiple_products_name_number_or_qty",
236
+ "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].net_quantity_or_measure_of_commodity_in_pkg",
237
+ "$.items[*]['@ondc/org/statutory_reqs_packaged_commodities'].expiry_date",
238
+ "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].nutritional_info",
239
+ "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].additives_info",
240
+ "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].brand_owner_FSSAI_license_no",
241
+ "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].other_FSSAI_license_no",
242
+ "$.items[*]['@ondc/org/statutory_reqs_prepackaged_food'].importer_FSSAI_license_no",
243
+ "$.items[*].tags[*].code",
244
+ "$.items[*].tags[*].list[*].code",
245
+ "$.items[*].tags[*].list[*].name",
246
+ "$.items[*].tags[*].list[*].value"
247
+ ]
248
+ }
@@ -10,6 +10,7 @@ import { compileInputToGo } from "./go-ast.js";
10
10
  import { getVariablesFromTest } from "../../../utils/general-utils/test-object-utils.js";
11
11
  import { ConvertArrayToStringGoStyle, removeAllSpecialCharacters, } from "../../../utils/general-utils/string-utils.js";
12
12
  import { markdownMessageGenerator } from "../documentation/markdown-message-generator.js";
13
+ import { MarkdownDocGenerator } from "../documentation/md-generator.js";
13
14
  const __filename = fileURLToPath(import.meta.url);
14
15
  const __dirname = path.dirname(__filename);
15
16
  const packageName = "validationpkg";
@@ -35,6 +36,7 @@ export class GoGenerator extends CodeGenerator {
35
36
  await writeAndFormatCode(this.rootPath, `./${packageName}/go.mod`, goMod, "text");
36
37
  await this.generateSessionDataCode();
37
38
  await this.generateUnitTestingCode();
39
+ await new MarkdownDocGenerator(this.validationConfig, this.errorCodes, this.rootPath).generateCode();
38
40
  };
39
41
  this.generateTestFunction = async (testObject) => {
40
42
  const template = readFileSync(path.resolve(__dirname, "./templates/test-object.mustache"), "utf-8");
@@ -5,10 +5,85 @@ package validationutils
5
5
  import (
6
6
  "fmt"
7
7
  "strings"
8
+ "sync"
8
9
 
9
10
  "github.com/AsaiYusuke/jsonpath"
10
11
  )
11
12
 
13
+ // Global cache for parsed JSONPath functions
14
+ var (
15
+ pathParserCache = make(map[string]func(interface{}) ([]interface{}, error))
16
+ parserCacheMu sync.RWMutex
17
+ cacheHits uint64
18
+ cacheMisses uint64
19
+ statsMu sync.Mutex
20
+ )
21
+
22
+ // getOrParseJSONPath retrieves a cached parser or parses and caches a new one
23
+ func getOrParseJSONPath(path string) (func(interface{}) ([]interface{}, error), error) {
24
+ // Try to get from cache first (read lock for fast concurrent reads)
25
+ parserCacheMu.RLock()
26
+ parser, exists := pathParserCache[path]
27
+ parserCacheMu.RUnlock()
28
+
29
+ if exists {
30
+ // Cache hit - use existing parser
31
+ statsMu.Lock()
32
+ cacheHits++
33
+ statsMu.Unlock()
34
+ return parser, nil
35
+ }
36
+
37
+ // Cache miss - need to parse
38
+ statsMu.Lock()
39
+ cacheMisses++
40
+ statsMu.Unlock()
41
+
42
+ // Acquire write lock to add to cache
43
+ parserCacheMu.Lock()
44
+ defer parserCacheMu.Unlock()
45
+
46
+ // Double-check after acquiring write lock (another goroutine might have added it)
47
+ if parser, exists := pathParserCache[path]; exists {
48
+ return parser, nil
49
+ }
50
+
51
+ // Parse the JSONPath expression
52
+ parser, err := jsonpath.Parse(path)
53
+ if err != nil {
54
+ return nil, fmt.Errorf("failed to parse JSONPath %s: %w", path, err)
55
+ }
56
+
57
+ // Cache it for future use
58
+ pathParserCache[path] = parser
59
+ return parser, nil
60
+ }
61
+
62
+ // GetParserCacheStats returns cache statistics
63
+ func GetParserCacheStats() (hits, misses uint64, size int) {
64
+ statsMu.Lock()
65
+ h, m := cacheHits, cacheMisses
66
+ statsMu.Unlock()
67
+
68
+ parserCacheMu.RLock()
69
+ s := len(pathParserCache)
70
+ parserCacheMu.RUnlock()
71
+
72
+ return h, m, s
73
+ }
74
+
75
+ // ClearParserCache clears the cache (useful for testing)
76
+ func ClearParserCache() {
77
+ parserCacheMu.Lock()
78
+ pathParserCache = make(map[string]func(interface{}) ([]interface{}, error))
79
+ parserCacheMu.Unlock()
80
+
81
+ statsMu.Lock()
82
+ cacheHits = 0
83
+ cacheMisses = 0
84
+ statsMu.Unlock()
85
+ }
86
+
12
87
  // isListOfStringsOrNull checks if the variable is a slice containing only strings or nil values
13
88
  func isListOfStringsOrNull(variable interface{}) bool {
14
89
  slice, ok := variable.([]interface{})
@@ -29,10 +104,30 @@ func isListOfStringsOrNull(variable interface{}) bool {
29
104
 
30
105
  // GetJsonPath queries a payload using JSONPath and returns the results
31
106
  func GetJsonPath(payload interface{}, path string, flattenResult bool) []interface{} {
32
- resolvedPath, resolvedData, err := resolveJSONPathData(path, payload)
33
- output, err := jsonpath.Retrieve(resolvedPath, resolvedData)
107
+ resolvedPath, resolvedData, err := resolveJSONPathData(path, payload)
34
108
  if err != nil {
35
- fmt.Printf("Error retrieving JSONPath %s: %v\n", path, err)
109
+ // fmt.Printf("Error resolving JSONPath %s: %v\n", path, err)
110
+ return []interface{}{}
111
+ }
112
+
113
+ // Get or parse the JSONPath - uses cache if available
114
+ parser, err := getOrParseJSONPath(resolvedPath)
115
+ if err != nil {
116
+ // fmt.Printf("Error parsing JSONPath %s: %v\n", resolvedPath, err)
117
+ return []interface{}{}
118
+ }
119
+
120
+ // Execute the parsed JSONPath function
121
+ result, err := parser(resolvedData)
122
+ if err != nil {
123
+ // fmt.Printf("Error retrieving JSONPath %s: %v\n", resolvedPath, err)
124
+ return []interface{}{}
125
+ }
126
+
127
+ // Result is already []interface{}
128
+ output := result
129
+
130
+ if len(output) == 0 {
36
131
  return []interface{}{}
37
132
  }
38
133
 
@@ -48,9 +143,6 @@ func GetJsonPath(payload interface{}, path string, flattenResult bool) []interfa
48
143
  output = flattenSlice(output)
49
144
  }
50
145
 
51
- if len(output) == 0 {
52
- return []interface{}{}
53
- }
54
146
  return output
55
147
  }
56
148
 
@@ -67,17 +159,15 @@ func flattenSlice(slice []interface{}) []interface{} {
67
159
  return result
68
160
  }
69
161
 
70
-
71
-
72
162
  func resolveJSONPathData(path string, data interface{}) (string, interface{}, error) {
73
- if input, ok := data.(ValidationInput); ok {
74
- if strings.HasPrefix(path, "$._EXTERNAL._SELF") {
75
- resolvedPath := strings.Replace(path, "$._EXTERNAL._SELF", "$", 1)
76
- return resolvedPath, input.ExternalData["_SELF"], nil
77
- }else if( strings.HasPrefix(path, "$._EXTERNAL")){
163
+ if input, ok := data.(ValidationInput); ok {
164
+ if strings.HasPrefix(path, "$._EXTERNAL._SELF") {
165
+ resolvedPath := strings.Replace(path, "$._EXTERNAL._SELF", "$", 1)
166
+ return resolvedPath, input.ExternalData["_SELF"], nil
167
+ } else if strings.HasPrefix(path, "$._EXTERNAL") {
78
168
  resolvedPath := strings.Replace(path, "$._EXTERNAL", "$", 1)
79
169
  return resolvedPath, input.ExternalData, nil
80
170
  }
81
- }
82
- return path, data, nil
83
- }
171
+ }
172
+ return path, data, nil
173
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ondc-code-generator",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "generate code from build.yaml ",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",