You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
### Fixed
11
11
12
-
-[Swagger] Refactored `publish_portal_product` to build published URLs dynamically from `SWAGGER_PORTAL_BASE_PATH`, support preview and section/table-of-contents paths, and return the resolved `liveUrl` or `previewUrl` in the publish response.
12
+
-[Swagger] Refactored `publish_portal_product` to build published URLs dynamically from `SWAGGER_PORTAL_BASE_PATH`, support preview and section/table-of-contents paths, and return the resolved `liveUrl` or `previewUrl`plus product, portal, and table-of-contents metadata in the publish response. If `portal.customDomain` is present, the client now uses it as the full host without appending the portal UI suffix.
Copy file name to clipboardExpand all lines: docs/products/SmartBear MCP Server/swagger-portal-integration.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,14 @@ The Swagger Portal client provides comprehensive portal and product management c
116
116
#### `publish_portal_product`
117
117
118
118
- Purpose: Publish a product's content to make it live or as preview. This endpoint publishes the current content of a product, making it visible to portal visitors. Use preview mode to test before going live.
119
-
- Returns: Publication status information, including the generated `liveUrl` for live publication or `previewUrl` for preview publication when the product can be resolved.
119
+
- Returns: Publication status information with the following structure:
120
+
-`success` (boolean): Publication success status
121
+
-`preview` (boolean): Whether this is a preview or live publication
122
+
-`liveUrl` (string, conditional): Generated live URL (only when preview is false)
123
+
-`previewUrl` (string, conditional): Generated preview URL (only when preview is true)
124
+
-`product` (object): Product metadata with fields: `id`, `name`, `slug`
125
+
-`portal` (object): Portal metadata with fields: `id`, `name`, `subdomain`, `customDomain`
126
+
-`tableOfContentsItem` (object | null): Table of contents metadata with fields: `id`, `slug`, `title`, `order`, `parentId` (null when tableOfContentsId is not provided or not found)
120
127
- Use case: Make product content visible to portal visitors, either as live content or preview for testing.
121
128
- Parameters:
122
129
@@ -126,7 +133,11 @@ The Swagger Portal client provides comprehensive portal and product management c
126
133
|`preview`| Whether to publish as preview (true) or live (false). Preview allows testing before going live. Defaults to false (live publication) | boolean | No |
127
134
|`tableOfContentsId`| Optional table of contents UUID, or identifier in the format 'portal-subdomain:product-slug:section-slug:table-of-contents-slug' used to resolve a specific live URL path | string | No |
128
135
129
-
The publish response now includes `liveUrl` for live publication and `previewUrl` for preview publication. The URL is built dynamically from the configured `portalBasePath`, so it works across dev2, int, and production environments. When `tableOfContentsId` resolves, the returned URL includes the section and table-of-contents path.
136
+
**Response Details:**
137
+
- When `portal.customDomain` is present, it is used as the full host in the generated URL without appending the portal UI suffix
138
+
- When `customDomain` is not present, the URL is built using `portal.subdomain` + the portal UI suffix (`.portal.swaggerhub.com`)
139
+
- When `tableOfContentsId` resolves successfully, the returned URL includes the section and table-of-contents path in the format: `/{productSlug}/{sectionSlug}/{tocSlug}`
140
+
- The response includes only essential fields from product, portal, and tableOfContentsItem following React/TypeScript best practices using Pick<> utility types
"The table of contents UUID, or identifier in the format 'portal-subdomain:product-slug:section-slug:table-of-contents-slug'",
342
+
"Optional table of contents UUID, or identifier in the format 'portal-subdomain:product-slug:section-slug:table-of-contents-slug'. When provided, publishPortalProduct uses it to resolve the published URL path for the returned preview/live link.",
343
343
),
344
344
preview: z
345
345
.boolean()
@@ -431,8 +431,12 @@ export type CreateTableOfContentsBody = Omit<
"Publish a product's content to make it live or as preview. This endpoint publishes the current content of a product, making it visible to portal visitors. Use preview mode to test before going live.",
110
+
"Publish a product's content to make it live or as preview. This endpoint publishes the current content of a product, making it visible to portal visitors. Use preview mode to test before going live. Optionally provide tableOfContentsId to form liveUrl or previewUrl for specific table-of-contents item or specific page url. Returns a PublishPortalProductResponse containing: success status, preview boolean, liveUrl or previewUrl (depending on preview mode), and narrowed metadata objects for product (id, name, slug), portal (id, name, subdomain, customDomain), and tableOfContentsItem (id, slug, title, order, parentId) when resolved.",
Copy file name to clipboardExpand all lines: src/tests/unit/common/__snapshots__/server-definitions.test.ts.snap
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10440,7 +10440,7 @@ None",
10440
10440
- productId (string) *required*: Product UUID or identifier in the format 'portal-subdomain:product-slug' - unique identifier for the product
10441
10441
- embed (array): List of related entities to embed in the response - e.g., ['tableOfContents', 'tableOfContents.swaggerhubApi'] to include table of contents and SwaggerHub API details
10442
10442
- page (number): Page number for paginated results - specifies which page of results to retrieve (default is 1)
10443
-
- size (number): Number of items per page for pagination - controls how many results are returned per page (default is 20)",
10443
+
- size (number): Number of items per page for pagination - controls how many results are returned per page (default is 10)",
10444
10444
"inputSchema": [
10445
10445
"embed",
10446
10446
"page",
@@ -10519,16 +10519,18 @@ None",
10519
10519
"readOnlyHint": true,
10520
10520
"title": "Swagger: Publish Portal Product",
10521
10521
},
10522
-
"description": "Publish a product's content to make it live or as preview. This endpoint publishes the current content of a product, making it visible to portal visitors. Use preview mode to test before going live.
10522
+
"description": "Publish a product's content to make it live or as preview. This endpoint publishes the current content of a product, making it visible to portal visitors. Use preview mode to test before going live. Optionally provide tableOfContentsId to form liveUrl or previewUrl for specific table-of-contents item or specific page url. Returns a PublishPortalProductResponse containing: success status, preview boolean, liveUrl or previewUrl (depending on preview mode), and narrowed metadata objects for product (id, name, slug), portal (id, name, subdomain, customDomain), and tableOfContentsItem (id, slug, title, order, parentId) when resolved.
10523
10523
10524
10524
**Toolset:** Products
10525
10525
10526
10526
**Parameters:**
10527
10527
- productId (string) *required*: Product UUID or identifier in the format 'portal-subdomain:product-slug' - unique identifier for the product
10528
+
- tableOfContentsId (string): Optional table of contents UUID, or identifier in the format 'portal-subdomain:product-slug:section-slug:table-of-contents-slug'. When provided, publishPortalProduct uses it to resolve the published URL path for the returned preview/live link.
10528
10529
- preview (boolean): Whether to publish as preview (true) or live (false). Preview allows testing before going live. Defaults to false (live publication) (default: false)",
0 commit comments