Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ac9fd648
Commit
ac9fd648
authored
Nov 28, 2015
by
Clayton Coleman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip go2idl instructions from generated swagger doc
Ignore doc lines starting with +
parent
a512d83a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
swagger_doc_generator.go
pkg/runtime/swagger_doc_generator.go
+6
-3
No files found.
pkg/runtime/swagger_doc_generator.go
View file @
ac9fd648
...
@@ -65,11 +65,14 @@ func fmtRawDoc(rawDoc string) string {
...
@@ -65,11 +65,14 @@ func fmtRawDoc(rawDoc string) string {
for
_
,
line
:=
range
strings
.
Split
(
rawDoc
,
"
\n
"
)
{
for
_
,
line
:=
range
strings
.
Split
(
rawDoc
,
"
\n
"
)
{
line
=
strings
.
TrimRight
(
line
,
" "
)
line
=
strings
.
TrimRight
(
line
,
" "
)
leading
:=
strings
.
TrimLeft
(
line
,
" "
)
if
line
==
""
{
// Keep paragraphs
switch
{
case
len
(
line
)
==
0
:
// Keep paragraphs
delPrevChar
()
delPrevChar
()
buffer
.
WriteString
(
"
\n\n
"
)
buffer
.
WriteString
(
"
\n\n
"
)
}
else
if
!
strings
.
HasPrefix
(
strings
.
TrimLeft
(
line
,
" "
),
"TODO"
)
{
// Ignore one line TODOs
case
strings
.
HasPrefix
(
leading
,
"TODO"
)
:
// Ignore one line TODOs
case
strings
.
HasPrefix
(
leading
,
"+"
)
:
// Ignore instructions to go2idl
default
:
if
strings
.
HasPrefix
(
line
,
" "
)
||
strings
.
HasPrefix
(
line
,
"
\t
"
)
{
if
strings
.
HasPrefix
(
line
,
" "
)
||
strings
.
HasPrefix
(
line
,
"
\t
"
)
{
delPrevChar
()
delPrevChar
()
line
=
"
\n
"
+
line
+
"
\n
"
// Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-someting..."
line
=
"
\n
"
+
line
+
"
\n
"
// Replace it with newline. This is useful when we have a line with: "Example:\n\tJSON-someting..."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment