Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InRequestVars + SeparateLogicalBlocks #16

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

Grueslayer
Copy link

Formatting options

Logical blocks can be separated by a newline using --separatelogicalblocks. For example:

@variables1=value1

# This is a comment
# This is another comment

# @someother metatag
# @name REQUEST_NAME_ONE

GET http://localhost:8080/api/v1/health HTTP/1.1
Content-Type: application/json

{
  "key": "value"
}

When using request variables (like optaining a token from a previous request) you may assign thie to a document after the request and don't force to put it at the top of the file.
This can be done by using --inrequestvars

###

# @name login

POST {{loginURL}} HTTP/1.1
Accept: application/json
Content-Type: application/x-www-form-urlencoded

client_secret={{clientSecret}}&client_id={{clientId}}&grant_type=client_credentials&scope={{scope}}

###

@token = {{login.response.body.$.access_token}}
@tokentype = {{login.response.body.$.token_type}}

###

@gorillamoe gorillamoe self-assigned this Sep 17, 2024
@gorillamoe gorillamoe added the enhancement New feature or request label Sep 17, 2024
@gorillamoe
Copy link
Member

I renamed the arguments to flags, so they are easier to read for my old eyes 🙈 and added some description for kulala-fmt -h, other than that, great addition!

@gorillamoe gorillamoe merged commit fde99db into main Sep 18, 2024
1 check passed
@gorillamoe gorillamoe deleted the inrequestvars_separatelogicalblocks branch September 18, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants