mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[PR #4187] [MERGED] feat: description field for request parameters and headers #4695
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#4695
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/4187
Author: @anwarulislam
Created: 7/14/2024
Status: ✅ Merged
Merged: 8/27/2024
Merged by: @nivedin
Base:
next← Head:feat/params-headers-desc📝 Commits (10+)
98a5e5cfeat: key-value component added for reuse7612dcechore: inspection result addedf01e8c1chore: addHoppRESTRequestschemav7b063a55feat: adddescriptionfor field for REST request headersfb9c211feat: adddescriptionfor field for GraphQL request headersd6a5867fix: synchronization logic b/w bulk edit context and the default viewa9583bffeat: support importingdescriptionfields from external sources20c783btest: fix failing tests7ea91adchore: include description field for computed headers54da171feat: adddescriptionfield for headers at the collection level📊 Changes
29 files changed (+1347 additions, -1073 deletions)
View changed files
📝
.github/workflows/tests.yml(+2 -2)📝
packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/multiple-child-collections-auth-headers-coll.json(+614 -614)📝
packages/hoppscotch-cli/src/__tests__/unit/fixtures/workspace-access.mock.ts(+7 -6)📝
packages/hoppscotch-cli/src/__tests__/unit/getters.spec.ts(+3 -2)📝
packages/hoppscotch-common/locales/en.json(+2 -0)📝
packages/hoppscotch-common/src/components.d.ts(+1 -0)📝
packages/hoppscotch-common/src/components/collections/Properties.vue(+1 -0)📝
packages/hoppscotch-common/src/components/graphql/Headers.vue(+109 -132)📝
packages/hoppscotch-common/src/components/http/Body.vue(+1 -0)📝
packages/hoppscotch-common/src/components/http/Headers.vue(+113 -140)➕
packages/hoppscotch-common/src/components/http/KeyValue.vue(+157 -0)📝
packages/hoppscotch-common/src/components/http/Parameters.vue(+45 -104)📝
packages/hoppscotch-common/src/helpers/curl/__tests__/curlparser.spec.js(+30 -0)📝
packages/hoppscotch-common/src/helpers/curl/curlparser.ts(+11 -11)📝
packages/hoppscotch-common/src/helpers/curl/sub_helpers/headers.ts(+6 -5)📝
packages/hoppscotch-common/src/helpers/curl/sub_helpers/queries.ts(+4 -3)📝
packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts(+8 -2)📝
packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts(+9 -8)📝
packages/hoppscotch-common/src/helpers/import-export/import/postman.ts(+37 -18)📝
packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts(+6 -0)...and 9 more files
📄 Description
Description
This PR introduces a new
descriptionfield for both request parameters and headers in the API documentation. This allows developers to provide clear and concise explanations for each parameter and header, enhancing the readability and usability of the documentation. It is also added for headers at the collection level.The
descriptionfield is also accounted for while importing from external sources (Postman,Insomnia&OpenAPI).A pre-existing issue where edits made to headers from the bulk edit context are not immediately reflected in the default view is resolved.
Closes HFE-535 HFE-538.
Preview
Changes
HttpKeyValuecomponent abstracting the active headers UI and related business logic for reuse across requestParameters&Headerstabs.descriptionfield. Thedescriptionfield is excluded while comparing against the key-value pairs from the bulk edit context since it isn't applicable.HoppCollectionschemav3- Headers at the collection level have an additionaldescriptionfield. Also, thev2schema is updated to consumeHoppRESTHeaders&GQLHeaderschema definitions without thedescriptionfield addition. Also,HoppRESTAuth&HoppGQLAuthschema definitions are consumed from theHoppRESTRequest&HoppGQLRequestv5schemas instead of from the entry point. This is done so that any field additions at the child level (auth,headers, etc) will require adding a new version forHoppCollectionto stay consistent and won't be implicitly supported by the existing latest version as was the case.HoppRESTRequestschemav7- Newdescriptionfield for headers and parameters.HoppGQLRequestschemav6- Newdescriptionfield for headers.descriptionfield from external sources.i18nstring additions.Node.js CIGH Action workflow config to includenext&patchbranches as triggers onpush&pull_requestevents.Note to reviewers
Ensure to verify the following flows:
REST/GQL) under a collection and observe the behaviour. Try exporting (individual/workspace level exports) and importing the same and verify if thedescriptionfields are populated. This applies to both personal and team workspaces.Authorizationtab, change the type and observe theAuthorizationheader addition with thedescriptionfield appearing empty and staying disabled.descriptionfield gets populated. Try changing the value at the collection level and verify it gets reflected. Inherited headers will stay disabled at a request level.We're following the convention where any changes under
@hoppscotch/datawill require a CLI version bump (@hoppscotch/datacontents get inlined in the CLI bundle), especially in this case where a new schema definition is added and the CLI would reject a collection conforming to the latest version without publishing the latest changes. The bump is done in #4275 scheduled for the next major release, hence not done in this PR.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.