mirror of
https://github.com/YMFE/yapi.git
synced 2024-11-27 04:40:08 +08:00
fix: har,postman 导入json-schema 为false
This commit is contained in:
parent
e5c9c25be8
commit
c4cb298624
@ -162,6 +162,7 @@ function postman(importDataModule){
|
||||
}
|
||||
|
||||
}else if(item === 'req_body_other' && reqType === 'json' && data.request.postData){
|
||||
res.req_body_is_json_schema = true
|
||||
res[item] = transformJsonToSchema(data.request.postData.text);
|
||||
}else if(item === "req_headers"){
|
||||
res[item] = [{
|
||||
@ -185,6 +186,7 @@ function postman(importDataModule){
|
||||
}else if(item === 'res_body_type'){
|
||||
res[item] = 'json';
|
||||
}else if(item === 'res_body' ){
|
||||
res.res_body_is_json_schema = true
|
||||
res[item] = transformJsonToSchema(data.response.content.text);
|
||||
}
|
||||
else{
|
||||
|
@ -163,7 +163,7 @@ function postman(importDataModule){
|
||||
|
||||
} else if(item === 'req_body_other') {
|
||||
if(data.headers.indexOf('application/json')>-1){
|
||||
|
||||
res.req_body_is_json_schema = true
|
||||
res[item] = transformJsonToSchema(data[reflect[item]])
|
||||
} else {
|
||||
res[item] = data[reflect[item]];
|
||||
@ -220,8 +220,13 @@ function postman(importDataModule){
|
||||
let res = data[0];
|
||||
let response = {};
|
||||
response['res_body_type'] = res.language === 'json' ? 'json' : 'raw'
|
||||
response['res_body'] = res.language === 'json' ? transformJsonToSchema(res.text): res.text;
|
||||
|
||||
// response['res_body'] = res.language === 'json' ? transformJsonToSchema(res.text): res.text;
|
||||
if(res.language === 'json') {
|
||||
response['res_body_is_json_schema'] = true
|
||||
response['res_body'] = transformJsonToSchema(res.text)
|
||||
} else {
|
||||
response['res_body'] = res.text
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user