docs playground
显示请求 Playground 的设置:是否启用、请求发送到的基础 URL、默认身份验证方式和超时时间。如果它没有自己的基础 URL,就会显示继承的 URL。此处没有草稿:命令返回后,更改会立即应用到你的文档站点,与在 API Studio 中保存一样。参见Playground。
bash
octri docs playground [show | set key=value …]octri docs playground set key=value …
更改一个或多个设置。值均为文本,但 true 和 false 除外,它们用于启用或关闭某项功能。@ 从文件读取值,例如 css=@docs.css。使用带点号的键可以设置另一项中的某个字段,例如 defaultAuth.type=bearer。你可以单独设置默认身份验证的一部分,另一部分会保留原值。
参数
key=valuestring必填设置。
| 值 | 含义 |
|---|---|
enabled | true 或 false |
baseUrl | 请求发送到的地址 |
defaultAuth.type | 读者开始使用的身份验证方式 |
defaultAuth.headerName | API 密钥所在的请求头 |
requestTimeoutMs | 请求可耗时的时长,以毫秒为单位 |
示例
显示 Playground
bash
octri docs playgroundOutput
✔ Loading playground
API playground off
baseUrl inherits https://api.acme.com/v1
defaultAuth.type inherit
defaultAuth.headerName Authorization
allowedOrigins none
requestTimeoutMs 10000
octri docs playground set key=value …将其指向沙盒
bash
octri docs playground set enabled=true baseUrl=https://sandbox.acme.com相关内容
octri docs theme:读取和更改外观设置:颜色、徽标、字体、布局和代码主题。- Playground