mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #2372] [CLOSED] feat: export hoppscotch collections as openapi document #3762
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#3762
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/2372
Author: @amk-dev
Created: 5/27/2022
Status: ❌ Closed
Base:
main← Head:feat/hopp-to-openapi📝 Commits (10+)
2d70183feat: add basic hopp collection to open api converter functionalc52fd7atest: add sample test for openapi conversion1dd2214feat: add openapi converter59b89dfrefactor: make generateOpenApiRequestBody functional68b7bb9refactor: update types for hopp request body95d364ftest: add tests for openapi body generation1ea3112fix: add condition for empty body and content type9ed8c4efeat: add auth supportbdce14efeat: support for foldersde7594ffeat: add getDataToWrite function📊 Changes
14 files changed (+1690 additions, -817 deletions)
View changed files
📝
packages/hoppscotch-app/components/collections/ImportExport.vue(+50 -8)📝
packages/hoppscotch-app/helpers/functional/json.ts(+10 -0)➕
packages/hoppscotch-app/helpers/import-export/export/__tests__/openapi.spec.ts(+887 -0)📝
packages/hoppscotch-app/helpers/import-export/export/hopp.ts(+4 -3)📝
packages/hoppscotch-app/helpers/import-export/export/index.ts(+52 -11)➕
packages/hoppscotch-app/helpers/import-export/export/openapi.ts(+468 -0)➕
packages/hoppscotch-app/jest-shims.d.ts(+7 -0)📝
packages/hoppscotch-app/jest.setup.js(+35 -0)📝
packages/hoppscotch-app/locales/en.json(+15 -6)📝
packages/hoppscotch-app/package.json(+1 -0)📝
packages/hoppscotch-data/package.json(+1 -1)📝
packages/hoppscotch-data/src/rest/content-types.ts(+9 -0)📝
packages/hoppscotch-data/src/rest/index.ts(+12 -8)📝
pnpm-lock.yaml(+139 -780)📄 Description
Closes #2092
Description
feature to export Hoppscotch collections as an Open API document.
Checks
Additional Information
Problems to tackle / limitations
1. No Support For Enviornment Variables1. Openapi doesn't support enviornment variables anywhere other than the server url
2. One way to tackle this is to replace env variables with their values when exporting, but sensitive env variables may get exported, not good from a security standpoint. but seems like the practical thing to do.
2. Openapi doesn't support giving values for authentication. eg: we can define the auth scheme is basic auth, but won't be able to give the username and password.
1. Workaround might be to generate the headers and add them to the headers object
3. When we convert a hopp collection to open api document, there are possible chances for missing data,
for eg: lets say we have two requests
1.POST https://jsonplaceholder.com/posts
2.POST https://someotherinfo.com/posts with some different body
So right now we don't have a way to represent these two requests in one openapi document. workaround might be to generate multiple openapi documents
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.