Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-go-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-go-utils
Commits
0840b09d
Commit
0840b09d
authored
3 years ago
by
Johan de Klerk
Browse files
Options
Downloads
Patches
Plain Diff
Docs
- Ignore tabs - Ignore fields marked with "-"
parent
92697b90
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
api_documentation/api_documentation.go
+7
-2
7 additions, 2 deletions
api_documentation/api_documentation.go
with
7 additions
and
2 deletions
api_documentation/api_documentation.go
+
7
−
2
View file @
0840b09d
...
...
@@ -318,6 +318,9 @@ func StructSchema(docs *Docs, t reflect.Type) (interface{}, error) {
var
err
error
fieldDesc
:=
f
.
Tag
.
Get
(
"doc"
)
if
fieldDesc
==
"-"
{
continue
}
if
fieldDesc
==
""
{
fieldDesc
=
description
+
"."
+
fieldName
}
...
...
@@ -336,7 +339,7 @@ func StructSchema(docs *Docs, t reflect.Type) (interface{}, error) {
element
:=
t
.
Elem
()
if
element
.
Kind
()
==
reflect
.
Struct
||
element
.
Kind
()
==
reflect
.
Ptr
{
elementName
:=
getTyp
e
(
t
)
elementName
:=
t
.
Elem
()
.
Nam
e
()
if
elementName
==
""
||
elementName
==
"error"
{
return
schema
,
nil
}
...
...
@@ -396,11 +399,13 @@ func GetStructDocs(corePath string) map[string]string {
for
_
,
objectTypes
:=
range
p
.
Types
{
doc
:=
strings
.
ReplaceAll
(
objectTypes
.
Doc
,
objectTypes
.
Name
,
""
)
doc
=
strings
.
ReplaceAll
(
doc
,
"
\t
"
,
""
)
docs
[
objectTypes
.
Name
]
=
doc
}
for
_
,
function
:=
range
p
.
Funcs
{
doc
:=
strings
.
ReplaceAll
(
function
.
Doc
,
function
.
Name
,
""
)
doc
=
strings
.
ReplaceAll
(
doc
,
"
\t
"
,
""
)
docs
[
function
.
Name
]
=
doc
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment