[PR #3825] [MERGED] feat: request variables #4537

Closed
opened 2026-03-17 02:03:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3825
Author: @nivedin
Created: 2/14/2024
Status: Merged
Merged: 3/7/2024
Merged by: @AndrewBastin

Base: release/2024.3.0Head: feat/request-variable


📝 Commits (10+)

  • 170ec15 refactor: add v2 request schema
  • 0ed0637 feat: add request variable
  • 2a0000c chore: remove unused file
  • 11e8ba7 refactor: add request variables to request runner flow
  • c27e1be refactor: update env tooltip
  • b278691 chore: update history
  • 3596331 refactor: add check for request variables for env inspector
  • ca1a4ec refactor: update codegen and curlparser
  • 7114f4f chore: update test cases in app
  • c8009ae chore: update test cases in cli

📊 Changes

54 files changed (+1273 additions, -506 deletions)

View changed files

📝 packages/hoppscotch-cli/src/__tests__/samples/collections/collection-level-headers-auth-coll.json (+15 -9)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/env-flag-tests-coll.json (+3 -2)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/fails-coll.json (+6 -4)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/malformed-coll.json (+7 -5)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/notjson-coll.txt (+4 -3)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/passes-coll.json (+6 -4)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/pre-req-script-env-var-persistence-coll.json (+3 -2)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/req-body-env-vars-coll.json (+3 -2)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/secret-envs-coll.json (+12 -6)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/secret-envs-persistence-coll.json (+12 -6)
📝 packages/hoppscotch-cli/src/__tests__/samples/collections/secret-envs-persistence-scripting-coll.json (+3 -2)
📝 packages/hoppscotch-common/assets/scss/styles.scss (+14 -4)
📝 packages/hoppscotch-common/locales/en.json (+2 -0)
📝 packages/hoppscotch-common/src/components/embeds/index.vue (+16 -2)
📝 packages/hoppscotch-common/src/components/http/Authorization.vue (+16 -5)
📝 packages/hoppscotch-common/src/components/http/Body.vue (+4 -0)
📝 packages/hoppscotch-common/src/components/http/BodyParameters.vue (+6 -0)
📝 packages/hoppscotch-common/src/components/http/CodegenModal.vue (+21 -1)
📝 packages/hoppscotch-common/src/components/http/Headers.vue (+11 -2)
📝 packages/hoppscotch-common/src/components/http/OAuth2Authorization.vue (+26 -4)

...and 34 more files

📄 Description

Closes HFE-404 HFE-432

Description

This PR add a feature which will provide users to specify a variable that is scoped to a request.

Request variables are variables whose scope is limited to the request. Users can now specify request variables using the notation <<variable>.

  • Request variables vs query params - Request variables can be part of a URL, for example:
    api.hoppscotch.io/user/<<variable>>
  • Request variables vs environment variables: The scope of request variables is limited to the request only, and they can be used in embeds.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3825 **Author:** [@nivedin](https://github.com/nivedin) **Created:** 2/14/2024 **Status:** ✅ Merged **Merged:** 3/7/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2024.3.0` ← **Head:** `feat/request-variable` --- ### 📝 Commits (10+) - [`170ec15`](https://github.com/hoppscotch/hoppscotch/commit/170ec158213a34bfef7edf984c6947103a5bde75) refactor: add v2 request schema - [`0ed0637`](https://github.com/hoppscotch/hoppscotch/commit/0ed063724e2c7d8315bc00effa2e2851ac04f9aa) feat: add request variable - [`2a0000c`](https://github.com/hoppscotch/hoppscotch/commit/2a0000cfc4c8e2d11e9011addce71a4c3492c4d2) chore: remove unused file - [`11e8ba7`](https://github.com/hoppscotch/hoppscotch/commit/11e8ba7bb391375cf336a64375625bff26e552d3) refactor: add request variables to request runner flow - [`c27e1be`](https://github.com/hoppscotch/hoppscotch/commit/c27e1be230fe3a9790adaeb19a6ebd5d524d77b5) refactor: update env tooltip - [`b278691`](https://github.com/hoppscotch/hoppscotch/commit/b278691a9d64bb99254973a4308af211419ea352) chore: update history - [`3596331`](https://github.com/hoppscotch/hoppscotch/commit/359633102e405944be6958a8748ee5b9a9dd82b0) refactor: add check for request variables for env inspector - [`ca1a4ec`](https://github.com/hoppscotch/hoppscotch/commit/ca1a4ec31b662e33070c6117baa96f04b52028cc) refactor: update codegen and curlparser - [`7114f4f`](https://github.com/hoppscotch/hoppscotch/commit/7114f4fd43b0b29e2253bf2b719251a7d481cc15) chore: update test cases in app - [`c8009ae`](https://github.com/hoppscotch/hoppscotch/commit/c8009aec7700ffa9758ff345dcb08904bf1f796d) chore: update test cases in cli ### 📊 Changes **54 files changed** (+1273 additions, -506 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/collection-level-headers-auth-coll.json` (+15 -9) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/env-flag-tests-coll.json` (+3 -2) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/fails-coll.json` (+6 -4) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/malformed-coll.json` (+7 -5) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/notjson-coll.txt` (+4 -3) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/passes-coll.json` (+6 -4) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/pre-req-script-env-var-persistence-coll.json` (+3 -2) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/req-body-env-vars-coll.json` (+3 -2) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/secret-envs-coll.json` (+12 -6) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/secret-envs-persistence-coll.json` (+12 -6) 📝 `packages/hoppscotch-cli/src/__tests__/samples/collections/secret-envs-persistence-scripting-coll.json` (+3 -2) 📝 `packages/hoppscotch-common/assets/scss/styles.scss` (+14 -4) 📝 `packages/hoppscotch-common/locales/en.json` (+2 -0) 📝 `packages/hoppscotch-common/src/components/embeds/index.vue` (+16 -2) 📝 `packages/hoppscotch-common/src/components/http/Authorization.vue` (+16 -5) 📝 `packages/hoppscotch-common/src/components/http/Body.vue` (+4 -0) 📝 `packages/hoppscotch-common/src/components/http/BodyParameters.vue` (+6 -0) 📝 `packages/hoppscotch-common/src/components/http/CodegenModal.vue` (+21 -1) 📝 `packages/hoppscotch-common/src/components/http/Headers.vue` (+11 -2) 📝 `packages/hoppscotch-common/src/components/http/OAuth2Authorization.vue` (+26 -4) _...and 34 more files_ </details> ### 📄 Description Closes HFE-404 HFE-432 ### Description This PR add a feature which will provide users to specify a variable that is scoped to a request. Request variables are variables whose scope is limited to the request. Users can now specify request variables using the notation `<<variable>`. - Request variables vs query params - Request variables can be part of a URL, for example: `api.hoppscotch.io/user/<<variable>>` - Request variables vs environment variables: The scope of request variables is limited to the request only, and they can be used in embeds. ### Checks - [x] My pull request adheres to the code style of this project - [x] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:03:56 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4537
No description provided.