[PR #1894] [CLOSED] Save example for request #3552

Closed
opened 2026-03-17 01:09:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/1894
Author: @sguzmanm
Created: 10/24/2021
Status: Closed

Base: mainHead: ISS-1875-save-example-request


📝 Commits (6)

  • b7353b6 feat: add support por session types and do initial scaffold for request view with example type
  • 11d64c1 feat: create UI for showing example responses in JSON for REST
  • fc33282 feat: listen to session type changes and include used requests in example
  • 95fa87b feat: listen to session type changes and include used requests in example
  • e051fd8 Merge branch 'ISS-1875-save-example-request' of https://github.com/sguzmanm/hoppscotch into ISS-1875-save-example-request
  • d928432 Merge branch 'main' into ISS-1875-save-example-request

📊 Changes

13 files changed (+440 additions, -13 deletions)

View changed files

packages/hoppscotch-app/components/collections/my/Example.vue (+195 -0)
📝 packages/hoppscotch-app/components/collections/my/Request.vue (+38 -0)
📝 packages/hoppscotch-app/components/history/index.vue (+5 -0)
📝 packages/hoppscotch-app/components/http/Request.vue (+14 -7)
📝 packages/hoppscotch-app/components/lenses/renderers/JSONLensRenderer.vue (+18 -0)
📝 packages/hoppscotch-app/components/smart/EnvInput.vue (+5 -1)
packages/hoppscotch-app/helpers/types/HoppRESTExample.ts (+84 -0)
📝 packages/hoppscotch-app/helpers/types/HoppRESTRequest.ts (+4 -1)
📝 packages/hoppscotch-app/helpers/types/HoppRESTResponse.ts (+4 -4)
packages/hoppscotch-app/helpers/types/HoppSessionType.ts (+5 -0)
📝 packages/hoppscotch-app/locales/en.json (+2 -0)
📝 packages/hoppscotch-app/locales/es.json (+2 -0)
📝 packages/hoppscotch-app/newstore/RESTSession.ts (+64 -0)

📄 Description

Hi, this is a draft for saving examples for a request. Honestly I have too many doubts regarding the change and how big it will be so I'm leaving here a demo of the current functionality to check if the change is going the right way and how I can improve it for merging:

https://user-images.githubusercontent.com/25377562/138613704-314cb555-8ce9-4278-98b3-b8774194e132.mov

So things I want to add to this change for a V1 version:

  • Change the example name

Doubts I have:

  1. Define what features should be visible when looking at a request example (for example, I'm not sure if it makes sense to add params when looking at an example)
  2. In which scenarios is saveRequest prop for components set to true? This is used mostly on the code for the Collections list in the right
    image
  3. As the code is today, to support saving examples we would have to change all lens renderers, user and global collections, and REST and GraphQL request views. Is that OK? Also I think we can do this in multiple PRs or just add the example feature with some sort of BETA flag to see if users like it and change other views progressively
  4. Is there any test suite for adding new changes to the repo? I see that there are multiple triggers or listeners involved, like Firebase for instance

Contributes to #1875


🔄 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/1894 **Author:** [@sguzmanm](https://github.com/sguzmanm) **Created:** 10/24/2021 **Status:** ❌ Closed **Base:** `main` ← **Head:** `ISS-1875-save-example-request` --- ### 📝 Commits (6) - [`b7353b6`](https://github.com/hoppscotch/hoppscotch/commit/b7353b6e1949bc90e27fb360715b0d8de8987114) feat: add support por session types and do initial scaffold for request view with example type - [`11d64c1`](https://github.com/hoppscotch/hoppscotch/commit/11d64c134567eeeff2666db54d8b527db1a2bdfc) feat: create UI for showing example responses in JSON for REST - [`fc33282`](https://github.com/hoppscotch/hoppscotch/commit/fc33282d44f47769b5827e348c1482de8fffc251) feat: listen to session type changes and include used requests in example - [`95fa87b`](https://github.com/hoppscotch/hoppscotch/commit/95fa87bd1f55d9c4bf77a440ffaaaa16b2600d23) feat: listen to session type changes and include used requests in example - [`e051fd8`](https://github.com/hoppscotch/hoppscotch/commit/e051fd8e1cf9d676b712fa39c0bbb1ea3a96f488) Merge branch 'ISS-1875-save-example-request' of https://github.com/sguzmanm/hoppscotch into ISS-1875-save-example-request - [`d928432`](https://github.com/hoppscotch/hoppscotch/commit/d9284321b04acc36cb0ac1a2d0dce392784ec891) Merge branch 'main' into ISS-1875-save-example-request ### 📊 Changes **13 files changed** (+440 additions, -13 deletions) <details> <summary>View changed files</summary> ➕ `packages/hoppscotch-app/components/collections/my/Example.vue` (+195 -0) 📝 `packages/hoppscotch-app/components/collections/my/Request.vue` (+38 -0) 📝 `packages/hoppscotch-app/components/history/index.vue` (+5 -0) 📝 `packages/hoppscotch-app/components/http/Request.vue` (+14 -7) 📝 `packages/hoppscotch-app/components/lenses/renderers/JSONLensRenderer.vue` (+18 -0) 📝 `packages/hoppscotch-app/components/smart/EnvInput.vue` (+5 -1) ➕ `packages/hoppscotch-app/helpers/types/HoppRESTExample.ts` (+84 -0) 📝 `packages/hoppscotch-app/helpers/types/HoppRESTRequest.ts` (+4 -1) 📝 `packages/hoppscotch-app/helpers/types/HoppRESTResponse.ts` (+4 -4) ➕ `packages/hoppscotch-app/helpers/types/HoppSessionType.ts` (+5 -0) 📝 `packages/hoppscotch-app/locales/en.json` (+2 -0) 📝 `packages/hoppscotch-app/locales/es.json` (+2 -0) 📝 `packages/hoppscotch-app/newstore/RESTSession.ts` (+64 -0) </details> ### 📄 Description Hi, this is a draft for saving examples for a request. Honestly I have too many doubts regarding the change and how big it will be so I'm leaving here a demo of the current functionality to check if the change is going the right way and how I can improve it for merging: https://user-images.githubusercontent.com/25377562/138613704-314cb555-8ce9-4278-98b3-b8774194e132.mov So things I want to add to this change for a V1 version: - Change the example name Doubts I have: 1. Define what features should be visible when looking at a request example (for example, I'm not sure if it makes sense to add params when looking at an example) 2. In which scenarios is saveRequest prop for components set to true? This is used mostly on the code for the Collections list in the right ![image](https://user-images.githubusercontent.com/25377562/138613842-072ef866-cc5b-4ad7-a873-241b0622e302.png) 3. As the code is today, to support saving examples we would have to change all lens renderers, user and global collections, and REST and GraphQL request views. Is that OK? Also I think we can do this in multiple PRs or just add the example feature with some sort of BETA flag to see if users like it and change other views progressively 4. Is there any test suite for adding new changes to the repo? I see that there are multiple triggers or listeners involved, like Firebase for instance Contributes to #1875 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:09:29 +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#3552
No description provided.