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
b2276b5d
Commit
b2276b5d
authored
Mar 12, 2015
by
nikhiljindal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating pkg/api/validation/ to consider swagger.items as object and not array
parent
e11f62cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
49 deletions
+17
-49
schema.go
pkg/api/validation/schema.go
+1
-1
v1beta1-swagger.json
pkg/api/validation/v1beta1-swagger.json
+16
-48
No files found.
pkg/api/validation/schema.go
View file @
b2276b5d
...
@@ -126,7 +126,7 @@ func (s *SwaggerSchema) validateField(value interface{}, apiVersion, fieldName,
...
@@ -126,7 +126,7 @@ func (s *SwaggerSchema) validateField(value interface{}, apiVersion, fieldName,
if
!
ok
{
if
!
ok
{
return
NewInvalidTypeError
(
reflect
.
Array
,
reflect
.
TypeOf
(
value
)
.
Kind
(),
fieldName
)
return
NewInvalidTypeError
(
reflect
.
Array
,
reflect
.
TypeOf
(
value
)
.
Kind
(),
fieldName
)
}
}
arrType
:=
*
fieldDetails
.
Items
[
0
]
.
Ref
arrType
:=
*
fieldDetails
.
Items
.
Ref
for
ix
:=
range
arr
{
for
ix
:=
range
arr
{
err
:=
s
.
validateField
(
arr
[
ix
],
apiVersion
,
fmt
.
Sprintf
(
"%s[%d]"
,
fieldName
,
ix
),
arrType
,
nil
)
err
:=
s
.
validateField
(
arr
[
ix
],
apiVersion
,
fmt
.
Sprintf
(
"%s[%d]"
,
fieldName
,
ix
),
arrType
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/api/validation/v1beta1-swagger.json
View file @
b2276b5d
...
@@ -943,11 +943,9 @@
...
@@ -943,11 +943,9 @@
"properties"
:
{
"properties"
:
{
"command"
:
{
"command"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"string"
"$ref"
:
"string"
}
}
]
},
},
"cpu"
:
{
"cpu"
:
{
"type"
:
"integer"
,
"type"
:
"integer"
,
...
@@ -955,11 +953,9 @@
...
@@ -955,11 +953,9 @@
},
},
"env"
:
{
"env"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.EnvVar"
"$ref"
:
"v1beta1.EnvVar"
}
}
]
},
},
"image"
:
{
"image"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -982,11 +978,9 @@
...
@@ -982,11 +978,9 @@
},
},
"ports"
:
{
"ports"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Port"
"$ref"
:
"v1beta1.Port"
}
}
]
},
},
"privileged"
:
{
"privileged"
:
{
"type"
:
"boolean"
"type"
:
"boolean"
...
@@ -996,11 +990,9 @@
...
@@ -996,11 +990,9 @@
},
},
"volumeMounts"
:
{
"volumeMounts"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.VolumeMount"
"$ref"
:
"v1beta1.VolumeMount"
}
}
]
},
},
"workingDir"
:
{
"workingDir"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -1018,11 +1010,9 @@
...
@@ -1018,11 +1010,9 @@
"properties"
:
{
"properties"
:
{
"containers"
:
{
"containers"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Container"
"$ref"
:
"v1beta1.Container"
}
}
]
},
},
"id"
:
{
"id"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -1038,11 +1028,9 @@
...
@@ -1038,11 +1028,9 @@
},
},
"volumes"
:
{
"volumes"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Volume"
"$ref"
:
"v1beta1.Volume"
}
}
]
}
}
}
}
},
},
...
@@ -1075,11 +1063,9 @@
...
@@ -1075,11 +1063,9 @@
},
},
"endpoints"
:
{
"endpoints"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"string"
"$ref"
:
"string"
}
}
]
},
},
"id"
:
{
"id"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -1130,11 +1116,9 @@
...
@@ -1130,11 +1116,9 @@
},
},
"items"
:
{
"items"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Endpoints"
"$ref"
:
"v1beta1.Endpoints"
}
}
]
},
},
"kind"
:
{
"kind"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -1260,11 +1244,9 @@
...
@@ -1260,11 +1244,9 @@
},
},
"items"
:
{
"items"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Event"
"$ref"
:
"v1beta1.Event"
}
}
]
},
},
"kind"
:
{
"kind"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -1288,11 +1270,9 @@
...
@@ -1288,11 +1270,9 @@
"properties"
:
{
"properties"
:
{
"command"
:
{
"command"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"string"
"$ref"
:
"string"
}
}
]
}
}
}
}
},
},
...
@@ -1482,22 +1462,18 @@
...
@@ -1482,22 +1462,18 @@
},
},
"items"
:
{
"items"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Minion"
"$ref"
:
"v1beta1.Minion"
}
}
]
},
},
"kind"
:
{
"kind"
:
{
"type"
:
"string"
"type"
:
"string"
},
},
"minions"
:
{
"minions"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Minion"
"$ref"
:
"v1beta1.Minion"
}
}
]
},
},
"namespace"
:
{
"namespace"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -1639,11 +1615,9 @@
...
@@ -1639,11 +1615,9 @@
},
},
"items"
:
{
"items"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Pod"
"$ref"
:
"v1beta1.Pod"
}
}
]
},
},
"kind"
:
{
"kind"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -1813,11 +1787,9 @@
...
@@ -1813,11 +1787,9 @@
},
},
"items"
:
{
"items"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.ReplicationController"
"$ref"
:
"v1beta1.ReplicationController"
}
}
]
},
},
"kind"
:
{
"kind"
:
{
"type"
:
"string"
"type"
:
"string"
...
@@ -1942,11 +1914,9 @@
...
@@ -1942,11 +1914,9 @@
},
},
"publicIPs"
:
{
"publicIPs"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"string"
"$ref"
:
"string"
}
}
]
},
},
"resourceVersion"
:
{
"resourceVersion"
:
{
"type"
:
"uint64"
"type"
:
"uint64"
...
@@ -1999,11 +1969,9 @@
...
@@ -1999,11 +1969,9 @@
},
},
"items"
:
{
"items"
:
{
"type"
:
"array"
,
"type"
:
"array"
,
"items"
:
[
"items"
:
{
{
"$ref"
:
"v1beta1.Service"
"$ref"
:
"v1beta1.Service"
}
}
]
},
},
"kind"
:
{
"kind"
:
{
"type"
:
"string"
"type"
:
"string"
...
...
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