mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-12 05:48:57 +00:00
Disable OpenAPI "Try it" when no servers are defined (#3791)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@gitbook/react-openapi': patch
|
||||
---
|
||||
|
||||
Disable OpenAPI "Try it" when no servers are defined
|
||||
@@ -220,7 +220,7 @@ function OpenAPICodeSampleFooter(props: {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!validateHttpMethod(method)) {
|
||||
if (!validateHttpMethod(method) || (!hasMultipleMediaTypes && servers.length === 0)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ function OpenAPICodeSampleFooter(props: {
|
||||
) : (
|
||||
<span />
|
||||
)}
|
||||
{!hideTryItPanel && (
|
||||
{!hideTryItPanel && servers.length > 0 && (
|
||||
<ScalarApiButton
|
||||
context={getOpenAPIClientContext(context)}
|
||||
method={method}
|
||||
|
||||
Reference in New Issue
Block a user