feat: add swag tool
This commit is contained in:
@@ -3,6 +3,7 @@ package swag
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/go-openapi/spec"
|
||||
)
|
||||
|
||||
@@ -184,7 +185,7 @@ func IsComplexSchema(schema *spec.Schema) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
//Object included, such as Object or []Object
|
||||
// Object included, such as Object or []Object
|
||||
for _, st := range schema.Type {
|
||||
if st == OBJECT {
|
||||
return true
|
||||
@@ -254,7 +255,7 @@ func BuildCustomSchema(types []string) (*spec.Schema, error) {
|
||||
}
|
||||
|
||||
// MergeSchema merge schemas
|
||||
func MergeSchema(dst *spec.Schema, src *spec.Schema) *spec.Schema {
|
||||
func MergeSchema(dst, src *spec.Schema) *spec.Schema {
|
||||
if len(src.Type) > 0 {
|
||||
dst.Type = src.Type
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user