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

Markdown code block with variables syntax support to response #1351

Open
luisnt opened this issue Feb 4, 2025 · 0 comments
Open

Markdown code block with variables syntax support to response #1351

luisnt opened this issue Feb 4, 2025 · 0 comments

Comments

@luisnt
Copy link

luisnt commented Feb 4, 2025


name: Markdown code block with variables syntax support to keyword for response

about: It would be useful to support variable syntax in the response block, within markdown code blocks in the REST Client. This would allow users to define and reference variables within code blocks without breaking syntax highlighting or requiring workarounds. Currently, variables are supported within request files but are not properly recognized inside markdown code blocks. Supporting this feature would:

  • Improve readability and maintainability of requests documented in markdown.
  • Enhance the user experience when writing API documentation with embedded requests.
  • Reduce the need for escaping or alternate syntax workarounds.

Expected Behavior

The {{token}} variable must be able to be extracted from the authentication response and used in subsequent requests, using only the "response:" keyword in the http block of the request, ending the request and starting the response, thus being able to read the returned values. This feature would benefit users who document APIs extensively in markdown while leveraging REST Client capabilities.

Example of how it should work:

POST /auth HTTP/1.1
host: 192.168.25.10
Content-Type: application/json

{
"username": "admin", "password":"admin123"
}

response:
@contentType = response.header.contentType
@token = response.body.token
POST /users HTTP/1.1
host: 192.168.25.10
Content-Type: {{contentType}}
Authorization: Bearer {{token}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant