fix delete title schema
This commit is contained in:
@@ -245,12 +245,12 @@ func removeAdditionalPropertiesWithDepth(schema interface{}, depth int) interfac
|
|||||||
if !ok || len(v) == 0 {
|
if !ok || len(v) == 0 {
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
|
// 删除所有的title字段
|
||||||
|
delete(v, "title")
|
||||||
// 如果type不为object和array,则直接返回
|
// 如果type不为object和array,则直接返回
|
||||||
if typeVal, exists := v["type"]; !exists || (typeVal != "object" && typeVal != "array") {
|
if typeVal, exists := v["type"]; !exists || (typeVal != "object" && typeVal != "array") {
|
||||||
return schema
|
return schema
|
||||||
}
|
}
|
||||||
delete(v, "title")
|
|
||||||
switch v["type"] {
|
switch v["type"] {
|
||||||
case "object":
|
case "object":
|
||||||
delete(v, "additionalProperties")
|
delete(v, "additionalProperties")
|
||||||
|
|||||||
Reference in New Issue
Block a user