[PR #5584] [MERGED] fix: resolve collection variable referencing issues #5266

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5584
Author: @nivedin
Created: 11/16/2025
Status: Merged
Merged: 11/24/2025
Merged by: @jamesgeorge007

Base: nextHead: fix/coll-var-codegen-bug


📝 Commits (3)

  • 55fa22d chore: pass self coll environments
  • 5a5a9f6 chore: pass coll var in codegen and cleanup
  • 9296788 chore: cleanup

📊 Changes

3 files changed (+124 additions, -62 deletions)

View changed files

📝 packages/hoppscotch-common/src/components/collections/Variables.vue (+8 -1)
📝 packages/hoppscotch-common/src/components/http/Codegen.vue (+115 -60)
📝 packages/hoppscotch-common/src/helpers/RequestRunner.ts (+1 -1)

📄 Description

Closes FE-1052 #5583

This PR fixes the issue where a collection could not self-reference variables within its properties. It also resolves an issue in codegen where collection variables were not being parsed correctly.

What's changed

Notes to reviewers


Summary by cubic

Fixes FE-1052/#5583 by allowing collections to self-reference their own variables and by making codegen correctly resolve collection variables alongside request and environment variables.

  • Bug Fixes
    • Exposes current collection variables in Variables.vue (with correct source) and orders them before inherited and global envs so self-references work.
    • Codegen builds a single final environment: request vars → collection vars → environment vars, filters empties, and resolves body/headers using that environment.
    • Correctly applies inherited auth and headers; adds safer error handling; exports filterNonEmptyEnvironmentVariables for reuse.

Written for commit 9296788860. Summary will update automatically on new commits.


🔄 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/5584 **Author:** [@nivedin](https://github.com/nivedin) **Created:** 11/16/2025 **Status:** ✅ Merged **Merged:** 11/24/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `fix/coll-var-codegen-bug` --- ### 📝 Commits (3) - [`55fa22d`](https://github.com/hoppscotch/hoppscotch/commit/55fa22de2da9cc878402509364e70d10132a63b6) chore: pass self coll environments - [`5a5a9f6`](https://github.com/hoppscotch/hoppscotch/commit/5a5a9f69171e1394f76a4b8b7c1a2ea81cd87465) chore: pass coll var in codegen and cleanup - [`9296788`](https://github.com/hoppscotch/hoppscotch/commit/9296788860333d19dfa0988295619c5b185d5897) chore: cleanup ### 📊 Changes **3 files changed** (+124 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components/collections/Variables.vue` (+8 -1) 📝 `packages/hoppscotch-common/src/components/http/Codegen.vue` (+115 -60) 📝 `packages/hoppscotch-common/src/helpers/RequestRunner.ts` (+1 -1) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes FE-1052 #5583 This PR fixes the issue where a collection could not self-reference variables within its properties. It also resolves an issue in codegen where collection variables were not being parsed correctly. ### What's changed <!-- Describe point by point the different things you have changed in this PR --> <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes FE-1052/#5583 by allowing collections to self-reference their own variables and by making codegen correctly resolve collection variables alongside request and environment variables. - **Bug Fixes** - Exposes current collection variables in Variables.vue (with correct source) and orders them before inherited and global envs so self-references work. - Codegen builds a single final environment: request vars → collection vars → environment vars, filters empties, and resolves body/headers using that environment. - Correctly applies inherited auth and headers; adds safer error handling; exports filterNonEmptyEnvironmentVariables for reuse. <sup>Written for commit 9296788860333d19dfa0988295619c5b185d5897. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:43:55 +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#5266
No description provided.