feat: request snippets plugin (#6910)
This commit is contained in:
@@ -53,6 +53,29 @@ export default function SwaggerUI(opts) {
|
||||
showExtensions: false,
|
||||
showCommonExtensions: false,
|
||||
withCredentials: undefined,
|
||||
requestSnippetsEnabled: false,
|
||||
requestSnippets: {
|
||||
generators: {
|
||||
"curl_bash": {
|
||||
title: "cURL (bash)",
|
||||
syntax: "bash"
|
||||
},
|
||||
"curl_powershell": {
|
||||
title: "cURL (PowerShell)",
|
||||
syntax: "powershell"
|
||||
},
|
||||
"curl_cmd": {
|
||||
title: "cURL (CMD)",
|
||||
syntax: "bash"
|
||||
},
|
||||
"node_native": {
|
||||
title: "Node.js (Native)",
|
||||
syntax: "javascript"
|
||||
},
|
||||
},
|
||||
defaultExpanded: true,
|
||||
languagesMask: null, // e.g. only show curl bash = ["curl_bash"]
|
||||
},
|
||||
supportedSubmitMethods: [
|
||||
"get",
|
||||
"put",
|
||||
@@ -107,7 +130,8 @@ export default function SwaggerUI(opts) {
|
||||
spec: {
|
||||
spec: "",
|
||||
url: constructorConfig.url
|
||||
}
|
||||
},
|
||||
requestSnippets: constructorConfig.requestSnippets
|
||||
}, constructorConfig.initialState)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user