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.

Idea: Simplify exports of response values (with plugin POC)

See original GitHub issue

I found myself quite often repeating exporting variables. Not 'cause they didn’t exists (I used @ref) but aliasing for a better read. See example:

###
# @name foobars
GET http://localhost:8080/

{{
  exports.bars = response.parsedBody.items[0].foo.bars
}}

### with alias
# @ref foobars
GET http://localhost:8080/{{foo}}

### no alias
# @ref foobars
GET http://localhost:8080/anther/{{foobars.items[0].foo.bars}}

To ease this, I wrote this tiny, quick & dirty plugin which adds a new meta data @exports allowing to do same in a one-liner.

###
# @name foobars
# @exports bars = response.parsedBody.items[0].foo.bars
GET http://localhost:8080/

###
# @ref foobars
GET http://localhost:8080/{{foo}}

Could be extended for multiple variables etc. One downside I see is that feature of @ref gets missing/unclear

wyt?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rngtngcommented, Dec 18, 2021

Closing…

0reactions
AnWebercommented, Dec 10, 2021

Yes I agree with you. I’m already noticing how I’m overloading quite a few people at work with the tool. On the other hand I want to be as much as possible a superset between rest-client and Intellij Http Client and for that reason I already have a lot of additional features. For example, why do I have the variables declaration when I can also use Javascript exports. The support of dotenv configuration and additionally support Intellij *.env.json. I’ll go and see if I can find suggestions for these problems in other projects, languages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Export IntelliJ editor themes as plugins - The JetBrains Blog
Today, I'd like to highlight a small but very useful feature for IDEs based on IntelliJ Platform – exporting editor color schemes as...
Read more >
Example Code To Simplify Your Imports and Exports
Example Code To Simplify Your Imports and Exports. These snippets cover the more common cases where custom code is necessary during import. Unique...
Read more >
Kong Proof-of-Concept using Minikube - ITNEXT
How to build a proof-of-concept in about 15 minutes. This guide is an update to a previous story of mine. Why another guide?...
Read more >
Nik Collection – Help center - DXO support
What is the value compared to Nik Google? ... How can I manually export or import presets / recipes into Nik Collection by...
Read more >
Simplification List for SAP S/4HANA 2021 Initial Shipment ...
1.4 The Simplification List SAP S/4HANA release 2021 Initial Shipment, Feature Pack ... 2.8 ABAP Test Framework: Export of ATC Results to 3rd...
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