[PR #3566] [MERGED] feat: convert json to interfaces #4435

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3566
Author: @rajdip-b
Created: 11/19/2023
Status: Merged
Merged: 12/3/2023
Merged by: @AndrewBastin

Base: release/2023.12.0Head: feat/convert-json-to-interfaces


📝 Commits (4)

  • b09aa3a feat: json response can be used to generate language specific interfaces
  • f2ca1b8 feat: quicktype
  • 4dbfcce chore: update toast message
  • 7164b34 chore: update tippy title

📊 Changes

9 files changed (+283 additions, -64 deletions)

View changed files

📝 packages/hoppscotch-common/locales/en.json (+2 -0)
📝 packages/hoppscotch-common/package.json (+1 -0)
📝 packages/hoppscotch-common/src/components.d.ts (+1 -0)
📝 packages/hoppscotch-common/src/components/graphql/Response.vue (+54 -47)
📝 packages/hoppscotch-common/src/components/lenses/renderers/JSONLensRenderer.vue (+46 -0)
📝 packages/hoppscotch-common/src/composables/lens-actions.ts (+23 -0)
packages/hoppscotch-common/src/helpers/utils/interfaceLanguages.ts (+26 -0)
packages/hoppscotch-common/src/helpers/utils/json-to-language.ts (+27 -0)
📝 pnpm-lock.yaml (+103 -17)

📄 Description

Closes #3551

Description

Added a feature to generate the interface type of JSON response into any other language.
image

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

Additional Information

Current behaviour:
image
image

Generated TypeScript interface:
image


🔄 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/3566 **Author:** [@rajdip-b](https://github.com/rajdip-b) **Created:** 11/19/2023 **Status:** ✅ Merged **Merged:** 12/3/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.12.0` ← **Head:** `feat/convert-json-to-interfaces` --- ### 📝 Commits (4) - [`b09aa3a`](https://github.com/hoppscotch/hoppscotch/commit/b09aa3aadff1d41f22e427d968f1e5c44772fe8a) feat: json response can be used to generate language specific interfaces - [`f2ca1b8`](https://github.com/hoppscotch/hoppscotch/commit/f2ca1b8d0bfac82fdcf44b00df09a55080af7546) feat: quicktype - [`4dbfcce`](https://github.com/hoppscotch/hoppscotch/commit/4dbfccef9ce846d441e6cd8dfee5a4fdb39d8eac) chore: update toast message - [`7164b34`](https://github.com/hoppscotch/hoppscotch/commit/7164b34f313353328b63251ed9c45106306000e9) chore: update tippy title ### 📊 Changes **9 files changed** (+283 additions, -64 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/locales/en.json` (+2 -0) 📝 `packages/hoppscotch-common/package.json` (+1 -0) 📝 `packages/hoppscotch-common/src/components.d.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/components/graphql/Response.vue` (+54 -47) 📝 `packages/hoppscotch-common/src/components/lenses/renderers/JSONLensRenderer.vue` (+46 -0) 📝 `packages/hoppscotch-common/src/composables/lens-actions.ts` (+23 -0) ➕ `packages/hoppscotch-common/src/helpers/utils/interfaceLanguages.ts` (+26 -0) ➕ `packages/hoppscotch-common/src/helpers/utils/json-to-language.ts` (+27 -0) 📝 `pnpm-lock.yaml` (+103 -17) </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 #3551 ### Description Added a feature to generate the interface type of JSON response into any other language. ![image](https://github.com/hoppscotch/hoppscotch/assets/83924254/6cf18a4a-ee97-431c-b370-d51c9d662f9d) <!-- 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 --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] 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 - [x] All the tests have passed ### Additional Information Current behaviour: ![image](https://github.com/hoppscotch/hoppscotch/assets/83924254/7d892c13-bb65-41aa-adac-ed4c2cfb086a) ![image](https://github.com/hoppscotch/hoppscotch/assets/83924254/d18bdd35-9ed1-4cb4-9804-93715245bd33) Generated TypeScript interface: ![image](https://github.com/hoppscotch/hoppscotch/assets/83924254/c4ef4f18-2976-4a37-be7e-a3a8d94ceee9) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:58:13 +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#4435
No description provided.