mirror of
https://gitee.com/johng/gf
synced 2026-06-26 09:27:31 +08:00
improve package goai
This commit is contained in:
@ -241,7 +241,7 @@ func formatRefToBytes(ref string) []byte {
|
||||
return []byte(fmt.Sprintf(`{"$ref":"#/components/schemas/%s"}`, ref))
|
||||
}
|
||||
|
||||
func isValidTag(key string) bool {
|
||||
func isValidParameterName(key string) bool {
|
||||
if key == "-" {
|
||||
return false
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ func (oai *OpenApiV3) newParameterRefWithStructMethod(field gstructs.Field, path
|
||||
parameter.Schema = schemaRef
|
||||
|
||||
// Ignore parameter.
|
||||
if !isValidTag(parameter.Name) {
|
||||
if !isValidParameterName(parameter.Name) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@ func (oai *OpenApiV3) structToSchema(object interface{}) (*Schema, error) {
|
||||
schema.Required = append(schema.Required, key)
|
||||
}
|
||||
}
|
||||
if !isValidTag(key) {
|
||||
if !isValidParameterName(key) {
|
||||
ignoreProperties = append(ignoreProperties, key)
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user