mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5322] [MERGED] feat(common): add support for post/put body schemas in openapi import #5156
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5322
Author: @anwarulislam
Created: 8/11/2025
Status: ✅ Merged
Merged: 8/20/2025
Merged by: @jamesgeorge007
Base:
next← Head:feat/openapi-body📝 Commits (10+)
2fab163feat: support for post/put body schemasa97f281fix: add error logging for sample generation in parseOpenAPIV2Body5521988fix: additional request parameters missing errors3d14c39feat: added sample body generation support for v3c54acd2feat: add JSON example generation for OpenAPI v2, v3, and v3.1 schemas61359e8feat: enhance request body example generation for OpenAPI v2 and v3213c294fix: correct typo in generateMixedArrayRequestBodyExample function namef03637cfix: simplify array item generation in generateExampleArrayFromOpenAPIV2ItemsObjectd9f8afdfeat: enhance media object example handling for OpenAPI v3 and v3.195cd082refactor: reorganize openapi directory structure📊 Changes
6 files changed (+640 additions, -35 deletions)
View changed files
📝
packages/hoppscotch-common/src/helpers/functional/json.ts(+8 -0)➕
packages/hoppscotch-common/src/helpers/import-export/import/openapi/example-generators/v2.ts(+189 -0)➕
packages/hoppscotch-common/src/helpers/import-export/import/openapi/example-generators/v3.ts(+133 -0)➕
packages/hoppscotch-common/src/helpers/import-export/import/openapi/example-generators/v31.ts(+145 -0)📝
packages/hoppscotch-common/src/helpers/import-export/import/openapi/index.ts(+154 -35)📝
packages/hoppscotch-sh-admin/src/components.d.ts(+11 -0)📄 Description
Closes FE-944 #2087
Functionality to generate sample objects from OpenAPI v2/v3 schemas and fix parsing of form data and body parameters for post and put requests.
Try importing from the collections below. And open a post/put request from the imported collection, then look at the
bodytab.Collections:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.