mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 01:06:00 +03:00
[PR #5676] [MERGED] feat: api documentation versioning #5313
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#5313
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/5676
Author: @mirarifhasan
Created: 12/8/2025
Status: ✅ Merged
Merged: 2/23/2026
Merged by: @jamesgeorge007
Base:
next← Head:feat/api-doc-versioning📝 Commits (10+)
43771fcfeat: add slug to PublishedDocs and update API endpointsc90c110chore: add schema validation and published docs URL fieldec44eddtest: fix broken test cases05ebbcefix: documentTree when update autoSync and allowed public api to call without version0d3a371feat: add environment support to PublishedDocsff061a5feat: introduce documentation versioning29fd344chore: add environment picker and version snapshot66fbf9echore: remove log statementsa27dd1bchore: cleanupbfd52dcchore: update test and cleanup📊 Changes
37 files changed (+3438 additions, -477 deletions)
View changed files
➕
packages/hoppscotch-backend/prisma/migrations/20251207122817_add_slug_to_published_docs/migration.sql(+31 -0)➕
packages/hoppscotch-backend/prisma/migrations/20260209063744_published_doc_environment/migration.sql(+4 -0)📝
packages/hoppscotch-backend/prisma/schema.prisma(+19 -12)📝
packages/hoppscotch-backend/src/errors.ts(+7 -0)📝
packages/hoppscotch-backend/src/published-docs/input-type.args.ts(+21 -0)📝
packages/hoppscotch-backend/src/published-docs/published-docs.controller.ts(+38 -11)➖
packages/hoppscotch-backend/src/published-docs/published-docs.dto.ts(+0 -19)📝
packages/hoppscotch-backend/src/published-docs/published-docs.model.ts(+124 -0)📝
packages/hoppscotch-backend/src/published-docs/published-docs.resolver.ts(+19 -1)📝
packages/hoppscotch-backend/src/published-docs/published-docs.service.spec.ts(+943 -54)📝
packages/hoppscotch-backend/src/published-docs/published-docs.service.ts(+280 -27)📝
packages/hoppscotch-backend/src/team-collection/team-collection.service.ts(+14 -17)📝
packages/hoppscotch-backend/src/user-collection/user-collection.service.ts(+19 -22)📝
packages/hoppscotch-common/locales/en.json(+27 -1)📝
packages/hoppscotch-common/src/components.d.ts(+11 -0)📝
packages/hoppscotch-common/src/components/collections/documentation/CollectionStructure.vue(+6 -3)➕
packages/hoppscotch-common/src/components/collections/documentation/EnvironmentPicker.vue(+191 -0)📝
packages/hoppscotch-common/src/components/collections/documentation/Preview.vue(+1 -0)➕
packages/hoppscotch-common/src/components/collections/documentation/PublishDocForm.vue(+169 -0)📝
packages/hoppscotch-common/src/components/collections/documentation/PublishDocModal.vue(+64 -101)...and 17 more files
📄 Description
Closes BE-685 FE-1124
What's changed
Backend Changes
Adds stable slugs to PublishedDocs and a new public endpoint to fetch docs by slug and version, enabling consistent URLs and version lists. The old id-based endpoint remains but is deprecated.
New Features
slug=idand removes duplicate docs per collection+version.PublishedDocsincludesslugandversions[]resolver returns all versions for the slug.createPublishedDocreuses a collection’s slug for new versions, retries on unique constraint races, and snapshots documentTree whenautoSync=false.Database Migration
pnpx prisma migrate deployFrontend Changes
https://github.com/user-attachments/assets/9fff4d4c-82a2-4487-8477-1518b1e04fb5
Notes to reviewers
Run DB migration.
Summary by cubic
Adds slug-based, versioned public URLs for PublishedDocs with read-only snapshots and optional environment attachments. Replaces id-based routes, adds a versions list and environment toggle in the UI, and fixes live version detection. Aligns with BE-685 and FE-1124.
New Features
Migration
Written for commit
756465f7ad. Summary will update on new commits.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.