fix: 兼容二维数组生成, 更新 go
This commit is contained in:
		@@ -30,6 +30,7 @@ type (
 | 
				
			|||||||
        Birthday string `json:"birthday"`
 | 
					        Birthday string `json:"birthday"`
 | 
				
			||||||
        Description string `json:"description"`
 | 
					        Description string `json:"description"`
 | 
				
			||||||
        Tag []string `json:"tag"`
 | 
					        Tag []string `json:"tag"`
 | 
				
			||||||
 | 
					        Tags [][]string `json:"tags"`
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    UserSearchReq {
 | 
					    UserSearchReq {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,7 +36,6 @@
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        "requestBody": {},
 | 
					 | 
				
			||||||
        "tags": [
 | 
					        "tags": [
 | 
				
			||||||
          "user-api"
 | 
					          "user-api"
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
@@ -63,7 +62,6 @@
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        "requestBody": {},
 | 
					 | 
				
			||||||
        "tags": [
 | 
					        "tags": [
 | 
				
			||||||
          "user-api"
 | 
					          "user-api"
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
@@ -90,7 +88,6 @@
 | 
				
			|||||||
            "type": "string"
 | 
					            "type": "string"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        "requestBody": {},
 | 
					 | 
				
			||||||
        "tags": [
 | 
					        "tags": [
 | 
				
			||||||
          "user-api"
 | 
					          "user-api"
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
@@ -116,7 +113,6 @@
 | 
				
			|||||||
            "type": "string"
 | 
					            "type": "string"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        "requestBody": {},
 | 
					 | 
				
			||||||
        "tags": [
 | 
					        "tags": [
 | 
				
			||||||
          "user-api"
 | 
					          "user-api"
 | 
				
			||||||
        ]
 | 
					        ]
 | 
				
			||||||
@@ -183,6 +179,15 @@
 | 
				
			|||||||
          "items": {
 | 
					          "items": {
 | 
				
			||||||
            "type": "string"
 | 
					            "type": "string"
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        "tags": {
 | 
				
			||||||
 | 
					          "type": "array",
 | 
				
			||||||
 | 
					          "items": {
 | 
				
			||||||
 | 
					            "type": "array",
 | 
				
			||||||
 | 
					            "items": {
 | 
				
			||||||
 | 
					              "type": "string"
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "title": "UserInfoReply",
 | 
					      "title": "UserInfoReply",
 | 
				
			||||||
@@ -191,20 +196,13 @@
 | 
				
			|||||||
        "age",
 | 
					        "age",
 | 
				
			||||||
        "birthday",
 | 
					        "birthday",
 | 
				
			||||||
        "description",
 | 
					        "description",
 | 
				
			||||||
        "tag"
 | 
					        "tag",
 | 
				
			||||||
 | 
					        "tags"
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "UserInfoReq": {
 | 
					    "UserInfoReq": {
 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
      "properties": {
 | 
					      "title": "UserInfoReq"
 | 
				
			||||||
        "id": {
 | 
					 | 
				
			||||||
          "type": "string"
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      "title": "UserInfoReq",
 | 
					 | 
				
			||||||
      "required": [
 | 
					 | 
				
			||||||
        "id"
 | 
					 | 
				
			||||||
      ]
 | 
					 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "UserSearchReq": {
 | 
					    "UserSearchReq": {
 | 
				
			||||||
      "type": "object",
 | 
					      "type": "object",
 | 
				
			||||||
@@ -227,10 +225,5 @@
 | 
				
			|||||||
      "name": "Authorization",
 | 
					      "name": "Authorization",
 | 
				
			||||||
      "in": "header"
 | 
					      "in": "header"
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  },
 | 
					  }
 | 
				
			||||||
  "security": [
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "apiKey": []
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  ]
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -390,6 +390,17 @@ func schemaOfField(member spec.Member) swaggerSchemaObject {
 | 
				
			|||||||
			core = schemaCore{Type: "object"}
 | 
								core = schemaCore{Type: "object"}
 | 
				
			||||||
		} else if refTypeName == "mapstringstring" {
 | 
							} else if refTypeName == "mapstringstring" {
 | 
				
			||||||
			core = schemaCore{Type: "object"}
 | 
								core = schemaCore{Type: "object"}
 | 
				
			||||||
 | 
							} else if strings.HasPrefix(refTypeName, "[]") {
 | 
				
			||||||
 | 
								core = schemaCore{Type: "array"}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								tempKind := swaggerMapTypes[strings.Replace(refTypeName, "[]", "", -1)]
 | 
				
			||||||
 | 
								ftype, format, ok := primitiveSchema(tempKind, refTypeName)
 | 
				
			||||||
 | 
								if ok {
 | 
				
			||||||
 | 
									core.Items = &swaggerItemsObject{Type: ftype, Format: format}
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
									core.Items = &swaggerItemsObject{Type: ft.String(), Format: "UNKNOWN"}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			core = schemaCore{
 | 
								core = schemaCore{
 | 
				
			||||||
				Ref: "#/definitions/" + refTypeName,
 | 
									Ref: "#/definitions/" + refTypeName,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user