mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5950] fix(common): fallback to operation title when summary is missing in O… #5428
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#5428
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/5950
Author: @hypergadam
Created: 3/5/2026
Status: 🔄 Open
Base:
main← Head:fix/openapi-import-title-fallback📝 Commits (3)
20948b3fix(common): fallback to operation title when summary is missing in OpenAPI import0b6770dfix(openapi): validate operation name candidates are non-empty stringsda7180cfix(openapi): prevent non-string values from being used as operation names📊 Changes
1 file changed (+25 additions, -2 deletions)
View changed files
📝
packages/hoppscotch-common/src/helpers/import-export/import/openapi/index.ts(+25 -2)📄 Description
Fix fallback naming for OpenAPI import
Closes #4612
What's changed
getOperationNamehelper that centralises request name resolution during OpenAPI/Swagger importoperationId → summary → "Untitled Request"tooperationId → summary → title → "Untitled Request"makeRESTRequestandmakeHoppRESTResponseOriginalRequestcall sites inconvertPathToHoppReqsobjectHasPropertytype guard to safely accesstitlewithout introducinganycastsNotes to reviewers
Problem: When importing an OpenAPI/Swagger spec where operations define
titlebut omit bothoperationIdandsummary, every request shows as "Untitled Request". Several code-gen tools (e.g. certain Swagger generators) emittitleon the operation object as a substitute forsummary.Why
title? Whiletitleis not part of the official OpenAPI Operation Object schema, it appears in real-world specs often enough to warrant a fallback. The fix uses a safe runtime check (objectHasProperty) so it is a no-op for conforming specs that already haveoperationIdorsummary.Scope: Single file change in
packages/hoppscotch-common/src/helpers/import-export/import/openapi/index.ts. No new dependencies, no API changes.Before:
After:
Summary by cubic
Ensure operation "title" is used as a fallback when "summary" is missing during OpenAPI import, so imported requests have better names.
Request names now resolve as: operationId > summary > title > "Untitled Request".
Written for commit 20948b388154bf8e8ea94e1b04b1d92278d0880c. Summary will update on new commits.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.