From e95dabb7749d49f5599071f1cabf4bdf3bfad807 Mon Sep 17 00:00:00 2001 From: Johan de Klerk <jdeklerk00@gmail.com> Date: Wed, 11 May 2022 15:58:39 +0200 Subject: [PATCH] Docs: Ignore tableName --- api_documentation/api_documentation.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/api_documentation/api_documentation.go b/api_documentation/api_documentation.go index 74b7882..6468275 100644 --- a/api_documentation/api_documentation.go +++ b/api_documentation/api_documentation.go @@ -192,8 +192,13 @@ func FillParameters(docs *Docs, handler handler_utils.Handler) ([]DocParam, erro return nil, err } + name := StructFieldName(structField) + if name == "tableName" { + continue + } + parameter := DocParam{ - Name: StructFieldName(structField), + Name: name, In: "query", Description: structField.Tag.Get("doc"), Schema: schema, @@ -311,14 +316,14 @@ func StructSchema(docs *Docs, t reflect.Type) (interface{}, error) { if fieldName == "" { fieldName = f.Name } - if fieldName == "-" { + if fieldName == "-" || fieldName == "tableName" { continue // json does not marshal these } fieldName = strings.Replace(fieldName, ",omitempty", "", -1) var err error fieldDesc := f.Tag.Get("doc") - if fieldDesc == "-" { + if fieldDesc == "-" { continue } if fieldDesc == "" { -- GitLab