[PR #3293] [MERGED] fix: fix issues with codegen #4327

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3293
Author: @amk-dev
Created: 8/25/2023
Status: Merged
Merged: 8/28/2023
Merged by: @AndrewBastin

Base: release/2023.8.0Head: fix/codegen-errors


📝 Commits (2)

  • 83aab35 fix: fix issues with httpsnippet upgrade
  • 2ce81e0 chore: fix HttpSnippet import

📊 Changes

5 files changed (+274 additions, -184 deletions)

View changed files

📝 package.json (+9 -0)
📝 packages/hoppscotch-common/package.json (+2 -1)
📝 packages/hoppscotch-common/src/helpers/new-codegen/har.ts (+9 -2)
📝 packages/hoppscotch-common/src/helpers/new-codegen/index.ts (+1 -1)
📝 pnpm-lock.yaml (+253 -180)

📄 Description

Closes HFE-150

Before

Generating code for requests were breaking. the package we were using httpsnippet was depending on ajv@6, but they didnt have it on their peerDependencies, it was picking up ajv@8 which are added by some other packages, which breaks httpsnippet.

After

Fixed it for now with pnpm's pnpm.packageExtensions which patches httpsnippets package.json to include the ajv@6 in peerDeps.

After the fix, codegeneration worked normally except for when there are no body. we set HAR.Request.postData as optional. but httpsnippet was considering it mandatory. to fix this, we use x-unknown as the postData.mimeType when the contentType is unknown.


🔄 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/3293 **Author:** [@amk-dev](https://github.com/amk-dev) **Created:** 8/25/2023 **Status:** ✅ Merged **Merged:** 8/28/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.8.0` ← **Head:** `fix/codegen-errors` --- ### 📝 Commits (2) - [`83aab35`](https://github.com/hoppscotch/hoppscotch/commit/83aab35a10b8e37007fa872f4a1ca81e152d7cb7) fix: fix issues with httpsnippet upgrade - [`2ce81e0`](https://github.com/hoppscotch/hoppscotch/commit/2ce81e01d2f58ecaa367d048dcafb0107951469f) chore: fix HttpSnippet import ### 📊 Changes **5 files changed** (+274 additions, -184 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+9 -0) 📝 `packages/hoppscotch-common/package.json` (+2 -1) 📝 `packages/hoppscotch-common/src/helpers/new-codegen/har.ts` (+9 -2) 📝 `packages/hoppscotch-common/src/helpers/new-codegen/index.ts` (+1 -1) 📝 `pnpm-lock.yaml` (+253 -180) </details> ### 📄 Description Closes HFE-150 **Before** Generating code for requests were breaking. the package we were using `httpsnippet` was depending on `ajv@6`, but they didnt have it on their peerDependencies, it was picking up ajv@8 which are added by some other packages, which breaks `httpsnippet`. **After** Fixed it for now with pnpm's `pnpm.packageExtensions` which patches httpsnippets package.json to include the ajv@6 in peerDeps. After the fix, codegeneration worked normally except for when there are no body. we set `HAR.Request.postData` as optional. but `httpsnippet` was considering it mandatory. to fix this, we use `x-unknown` as the `postData.mimeType` when the contentType is unknown. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:52:28 +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#4327
No description provided.