question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameterized csvSource with body payload from reusable external JSON file

See original GitHub issue

From Slack: @Dorian

Hello, is it possible to use csv data in a reused son?

Because the ${0} like variables in the file aren’t getting swapped with the values from the csv.

...
"body": "${JSON.FILE:notification-api/parameterizable_body_pos_csv.json}" 
...
"parameterized": {
    "csvSource": [
      "Amelia, Loska, 1969-02-06, female, Im Grunde 082, Thörnich, 54340",
      "Pauline, Brand, 1967-01-29, female, Schöneberger Str. 71, Strande, 24229"
    ]
  }

This looks like anew feature request which needs to be implemented.

Please recheck the behavior before implementing it.

Current: Inline CSV data in the "parameterized" block work fine

Desired: CSV data from external source should work in similar fashion.

AC Details

From the perspective of the changes, the following is a better way. e.g. Currently, it works this way.

    "parameterized": {
        "csvSource":[
            "octocat,      The Octocat, San Francisco, 583231",
            "siddhagalaxy, Sidd,        UK,            33847730"
        ]
    }

What should be ideal is to source this from a CSV file e.g.

    "parameterized": {
        "csvSource":"${CSV.FILE:my_data/params.csv}"
    }

where the params.csv content will be e.g.

user,name,city,userid
octocat,The Octocat,San Francisco,583231
siddhagalaxy,Sidd,UK,33847730

The 1st line is the header which can be ignored while reading.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Sauhardstarkcommented, Jul 17, 2020

Hi @authorjapps I’m trying to understand the above issue and I understood that something like the below might be required.


"parameterized": {
    "csvFileSource": {
     test.json
    }
  }

Now the csvFileSource can also be a list. I’m more or less sure that the above is wrong. Could you please correct my understanding here.

Also I’m a little unclear on the reused son part. Can we please have a chat regarding this on Slack

0reactions
automationuser-mcommented, Apr 22, 2022

Similar requirement has been requested in https://github.com/authorjapps/zerocode-hello-world/issues/29 as well. Parameterization of external files will be important feature that could solve multiple challenges.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parameterize like a pro with JUnit 5 @CsvSource
Parameterized tests are definitely my favorite feature of JUnit 5. Defining multiple sets of arguments for the same test can significantly ...
Read more >
Set the JSON body from an external JSON file in Postman
In this short tutorial, I will show you how to get your entire JSON request body from an external file. This can be...
Read more >
Parameterize fields of json body passed as an external file
Hello, How to parameterize fields of JSON body passed as an external file ? Appreciate your help.
Read more >
Intake Documentation
files, Intake servers or third-party data services ... documentation for CSVSource and gets passed down to the CSV reader:.
Read more >
Known Issues for Oracle SOA Products 12.1.3
schema/Ignore_Duplicate_Components=true; 3. Save the file and restart the SOA server. Refreshing the SOA Composite Editor to Make WSDL Files Accessible. Bug: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found