[PR #2243] [MERGED] Open API support for post/put body schemas #3690

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

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/2243
Author: @RishabhAgarwal-2001
Created: 4/8/2022
Status: Merged
Merged: 6/29/2022
Merged by: @AndrewBastin

Base: orphan-pr/2243Head: 2087-openapi


📝 Commits (10+)

  • 2244d38 feat: oasv2 example generation complete
  • a04b634 refactor: removed unecessary const
  • 14e9d19 feat: v3 requests example working
  • 2aef9c5 refactor: examplev2 created and lintfix
  • 2fd9eb0 refactor: address comments
  • 3a41d79 feat: handle oneof and anyof
  • b0071e6 feat: oasv2 example generation complete
  • 721a201 refactor: removed unecessary const
  • bc2f81f feat: v3 requests example working
  • ed49c0b refactor: examplev2 created and lintfix

📊 Changes

5 files changed (+464 additions, -7 deletions)

View changed files

📝 packages/hoppscotch-app/helpers/functional/json.ts (+8 -0)
packages/hoppscotch-app/helpers/import-export/import/openapi/exampleV2.ts (+185 -0)
packages/hoppscotch-app/helpers/import-export/import/openapi/exampleV3.ts (+109 -0)
packages/hoppscotch-app/helpers/import-export/import/openapi/exampleV31.ts (+129 -0)
📝 packages/hoppscotch-app/helpers/import-export/import/openapi/index.ts (+33 -7)

📄 Description

Closes #2087

Description

PR introduces the feature of generating body examples from a schema definition. PR is a WIP and thus created as a draft PR.

  • Add Open API V2 support for primitive types
  • Add Open API V2 support for the array type
  • Add Open API V2 support for the object type
  • Add Open API V3 support for primitive types
  • Add Open API V3 support for the array type
  • Add Open API V3 support for the object type
  • Transform example based on content-type

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

🔄 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/2243 **Author:** [@RishabhAgarwal-2001](https://github.com/RishabhAgarwal-2001) **Created:** 4/8/2022 **Status:** ✅ Merged **Merged:** 6/29/2022 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `orphan-pr/2243` ← **Head:** `2087-openapi` --- ### 📝 Commits (10+) - [`2244d38`](https://github.com/hoppscotch/hoppscotch/commit/2244d38439e813faacb5b4f8ada80852e32c7ecc) feat: oasv2 example generation complete - [`a04b634`](https://github.com/hoppscotch/hoppscotch/commit/a04b634089d0e3f3cb0dff3f78e078b06201ed23) refactor: removed unecessary const - [`14e9d19`](https://github.com/hoppscotch/hoppscotch/commit/14e9d19ae69d01f6bac3f92999734e5f02ac7732) feat: v3 requests example working - [`2aef9c5`](https://github.com/hoppscotch/hoppscotch/commit/2aef9c56910cb323a8f19146cf985a12ce16a404) refactor: examplev2 created and lintfix - [`2fd9eb0`](https://github.com/hoppscotch/hoppscotch/commit/2fd9eb0767f22d358b5cdcc24960bc54ab3fb943) refactor: address comments - [`3a41d79`](https://github.com/hoppscotch/hoppscotch/commit/3a41d79c2f9c286dffb1df4a00d587974bae1c46) feat: handle oneof and anyof - [`b0071e6`](https://github.com/hoppscotch/hoppscotch/commit/b0071e6859ccea32cd6882d91ea777e905d30b45) feat: oasv2 example generation complete - [`721a201`](https://github.com/hoppscotch/hoppscotch/commit/721a201e7adfdb08d96d55c3fbf51dfb311c7a58) refactor: removed unecessary const - [`bc2f81f`](https://github.com/hoppscotch/hoppscotch/commit/bc2f81ff2587eac9123fe6029d8618fbdb02ca8a) feat: v3 requests example working - [`ed49c0b`](https://github.com/hoppscotch/hoppscotch/commit/ed49c0b72c20b2a7050b7b39b7b9d68c9df15636) refactor: examplev2 created and lintfix ### 📊 Changes **5 files changed** (+464 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-app/helpers/functional/json.ts` (+8 -0) ➕ `packages/hoppscotch-app/helpers/import-export/import/openapi/exampleV2.ts` (+185 -0) ➕ `packages/hoppscotch-app/helpers/import-export/import/openapi/exampleV3.ts` (+109 -0) ➕ `packages/hoppscotch-app/helpers/import-export/import/openapi/exampleV31.ts` (+129 -0) 📝 `packages/hoppscotch-app/helpers/import-export/import/openapi/index.ts` (+33 -7) </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 #2087 ### Description PR introduces the feature of generating body examples from a schema definition. PR is a WIP and thus created as a draft PR. - [x] Add Open API V2 support for primitive types - [x] Add Open API V2 support for the array type - [x] Add Open API V2 support for the object type - [x] Add Open API V3 support for primitive types - [x] Add Open API V3 support for the array type - [x] Add Open API V3 support for the object type - [ ] Transform example based on content-type ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [ ] 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:16:51 +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#3690
No description provided.