fetch spec from url provided in query parameter
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import YAML from "js-yaml"
|
||||
import { parseSeach } from "core/utils"
|
||||
import yamlConfig from "../../../swagger-config.yaml"
|
||||
|
||||
const CONFIGS = [ "url", "spec", "validatorUrl", "onComplete", "onFailure", "authorizations", "docExpansion",
|
||||
@@ -16,22 +17,6 @@ const parseYamlConfig = (yaml, system) => {
|
||||
}
|
||||
}
|
||||
|
||||
const parseSeach = () => {
|
||||
let map = {}
|
||||
let search = window.location.search
|
||||
|
||||
if ( search != "" ) {
|
||||
let params = search.substr(1).split("&");
|
||||
|
||||
for (let i in params) {
|
||||
i = params[i].split("=");
|
||||
map[decodeURIComponent(i[0])] = decodeURIComponent(i[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
export default function configPlugin (toolbox) {
|
||||
let { fn } = toolbox
|
||||
|
||||
Reference in New Issue
Block a user