File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,13 +184,12 @@ transform:
184184Reusable JavaScript functions for all transforms :
185185
186186` ` ` yaml
187- global_helpers:
188- js: |
189- function requireInt(val, name) {
190- const n = parseInt(val);
191- if (isNaN(n)) throw { status: 400, body: { error: name + ' required' } };
192- return n;
193- }
187+ global_helpers: |
188+ function requireInt(val, name) {
189+ const n = parseInt(val);
190+ if (isNaN(n)) throw { status: 400, body: { error: name + ' required' } };
191+ return n;
192+ }
194193
195194queries:
196195 - type: one
@@ -232,15 +231,21 @@ mock:
232231 - { id: 2, name: Bob }
233232 # or
234233 array_json: '[{"id": 1}, {"id": 2}]' # JSON string
234+ array_json_file: ./data/users.json # External JSON file
235235 # or
236236 csv: | # CSV with header
237237 id,name
238238 1,Alice
239239 2,Bob
240+ csv_file: ./data/users.csv # External CSV file
240241 # or
241242 jsonl: | # JSON Lines
242243 {"id": 1, "name": "Alice"}
243244 {"id": 2, "name": "Bob"}
245+ jsonl_file: ./data/users.jsonl # External JSONL file
246+ # or
247+ array_js: | # JavaScript (dynamic)
248+ return [{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }];
244249` ` `
245250
246251# ## Array Sources with Filter (for `type: one`)
You can’t perform that action at this time.
0 commit comments