Skip to content

Commit

Permalink
Add routes for structType and mapType in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mariantalla committed Dec 17, 2019
1 parent 7c6c06e commit a0384dd
Show file tree
Hide file tree
Showing 3 changed files with 285 additions and 29 deletions.
4 changes: 4 additions & 0 deletions test/integration/builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ func createWebServices() []*restful.WebService {
w.Route(buildRouteForType(w, "custom", "Bak"))
w.Route(buildRouteForType(w, "custom", "Bac"))
w.Route(buildRouteForType(w, "custom", "Bah"))
w.Route(buildRouteForType(w, "maptype", "GranularMap"))
w.Route(buildRouteForType(w, "maptype", "AtomicMap"))
w.Route(buildRouteForType(w, "structtype", "GranularStruct"))
w.Route(buildRouteForType(w, "structtype", "AtomicStruct"))
return []*restful.WebService{w}
}

Expand Down
170 changes: 141 additions & 29 deletions test/integration/pkg/generated/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 140 additions & 0 deletions test/integration/testdata/golden.v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,82 @@
}
}
},
"/test/maptype/atomicmap": {
"get": {
"schemes": [
"https"
],
"operationId": "func15",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/maptype.AtomicMap"
}
},
"404": {
"$ref": "#/responses/NotFound"
}
}
}
},
"/test/maptype/granularmap": {
"get": {
"schemes": [
"https"
],
"operationId": "func14",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/maptype.GranularMap"
}
},
"404": {
"$ref": "#/responses/NotFound"
}
}
}
},
"/test/structtype/atomicstruct": {
"get": {
"schemes": [
"https"
],
"operationId": "func17",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/structtype.AtomicStruct"
}
},
"404": {
"$ref": "#/responses/NotFound"
}
}
}
},
"/test/structtype/granularstruct": {
"get": {
"schemes": [
"https"
],
"operationId": "func16",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/structtype.GranularStruct"
}
},
"404": {
"$ref": "#/responses/NotFound"
}
}
}
},
"/test/uniontype/inlinedunion": {
"get": {
"schemes": [
Expand Down Expand Up @@ -403,6 +479,70 @@
}
}
},
"maptype.AtomicMap": {
"type": "object",
"required": [
"KeyValue"
],
"properties": {
"KeyValue": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-kubernetes-map-type": "atomic"
}
}
},
"maptype.GranularMap": {
"type": "object",
"required": [
"KeyValue"
],
"properties": {
"KeyValue": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"x-kubernetes-map-type": "granular"
}
}
},
"structtype.AtomicStruct": {
"type": "object",
"required": [
"Field",
"OtherField"
],
"properties": {
"Field": {
"type": "string",
"x-kubernetes-map-type": "atomic"
},
"OtherField": {
"type": "integer",
"format": "int32"
}
}
},
"structtype.GranularStruct": {
"type": "object",
"required": [
"Field",
"OtherField"
],
"properties": {
"Field": {
"type": "string",
"x-kubernetes-map-type": "granular"
},
"OtherField": {
"type": "integer",
"format": "int32"
}
}
},
"uniontype.InlinedUnion": {
"type": "object",
"required": [
Expand Down

0 comments on commit a0384dd

Please sign in to comment.