Compare commits

...

1 Commits

Author SHA1 Message Date
Nolann B. 262749a0b1 Copy the current spec's server in OpenAPI endpoint URLs (#4794) 2026-11-16 20:12:40 +01:00
2 changed files with 9 additions and 1 deletions
@@ -0,0 +1,5 @@
---
"@gitbook/react-openapi": patch
---
Copy the current spec's server in OpenAPI endpoint URLs instead of a server kept from a previously visited page.
@@ -36,11 +36,14 @@ export function OpenAPIPathMultipleServers(
};
});
// The store outlives client-side navigation, so it can hold a server from another spec.
const selectedServer = items.find((item) => item.key === key)?.key ?? defaultServer;
return (
<OpenAPIPathItem
copyType="button"
{...props}
value={`${withServer ? key : ''}${path}`}
value={`${withServer ? selectedServer : ''}${path}`}
context={context}
>
{withServer ? (