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
f826bf6b
Commit
f826bf6b
authored
Mar 28, 2015
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pick up the latest updates to go-restful.
parent
37689038
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
Godeps.json
Godeps/Godeps.json
+2
-2
model_builder.go
...c/github.com/emicklei/go-restful/swagger/model_builder.go
+14
-0
No files found.
Godeps/Godeps.json
View file @
f826bf6b
...
...
@@ -170,8 +170,8 @@
},
{
"ImportPath"
:
"github.com/emicklei/go-restful"
,
"Comment"
:
"v1.1.3-
29-gc68bc68
"
,
"Rev"
:
"
c68bc68d7689f127ab554a42378aece0ea3df4b3
"
"Comment"
:
"v1.1.3-
34-g5e1952e
"
,
"Rev"
:
"
5e1952ed0806503c059e4463c2654200660f484b
"
},
{
"ImportPath"
:
"github.com/evanphx/json-patch"
,
...
...
Godeps/_workspace/src/github.com/emicklei/go-restful/swagger/model_builder.go
View file @
f826bf6b
...
...
@@ -106,6 +106,15 @@ func (b modelBuilder) buildProperty(field reflect.StructField, model *Model, mod
return
b
.
buildArrayTypeProperty
(
field
,
jsonName
,
modelName
)
case
fieldKind
==
reflect
.
Ptr
:
return
b
.
buildPointerTypeProperty
(
field
,
jsonName
,
modelName
)
case
fieldKind
==
reflect
.
String
:
stringt
:=
"string"
prop
.
Type
=
&
stringt
return
jsonName
,
prop
case
fieldKind
==
reflect
.
Map
:
// if it's a map, it's unstructured, and swagger 1.2 can't handle it
anyt
:=
"any"
prop
.
Type
=
&
anyt
return
jsonName
,
prop
}
if
b
.
isPrimitiveType
(
fieldType
.
String
())
{
...
...
@@ -155,6 +164,10 @@ func (b modelBuilder) buildStructTypeProperty(field reflect.StructField, jsonNam
if
required
{
model
.
Required
=
append
(
model
.
Required
,
k
)
}
// Add the model type to the global model list
if
v
.
Ref
!=
nil
{
b
.
Models
[
*
v
.
Ref
]
=
sub
.
Models
[
*
v
.
Ref
]
}
}
// empty name signals skip property
return
""
,
prop
...
...
@@ -258,6 +271,7 @@ func (b modelBuilder) jsonSchemaType(modelName string) string {
"int"
:
"integer"
,
"int32"
:
"integer"
,
"int64"
:
"integer"
,
"uint64"
:
"integer"
,
"byte"
:
"string"
,
"float64"
:
"number"
,
"float32"
:
"number"
,
...
...
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