Fixed some minor errors in openapi

update pull request
This commit is contained in:
aaa 2019-06-03 06:05:35 -04:00
parent f532d5ca4b
commit 3025b3097a

View File

@ -147,7 +147,7 @@ type mapSchemaVisitor struct {
Result *proto.Map Result *proto.Map
} }
// MergeMap implements openapi // VisitMap implements openapi
func (v *mapSchemaVisitor) VisitMap(result *proto.Map) { func (v *mapSchemaVisitor) VisitMap(result *proto.Map) {
v.Result = result v.Result = result
v.Kind = "map" v.Kind = "map"
@ -173,7 +173,7 @@ func (v *arraySchemaVisitor) VisitArray(result *proto.Array) {
v.Err = copySubElementPatchStrategy(result.Path.String(), result.GetExtensions(), result.SubType.GetExtensions()) v.Err = copySubElementPatchStrategy(result.Path.String(), result.GetExtensions(), result.SubType.GetExtensions())
} }
// copyPatchStrategy copies the strategies to subelements to the subtype // copySubElementPatchStrategy copies the strategies to subelements to the subtype
// e.g. PodTemplate.Volumes is a []Volume with "x-kubernetes-patch-strategy": "merge,retainKeys" // e.g. PodTemplate.Volumes is a []Volume with "x-kubernetes-patch-strategy": "merge,retainKeys"
// the "retainKeys" strategy applies to merging Volumes, and must be copied to the sub element // the "retainKeys" strategy applies to merging Volumes, and must be copied to the sub element
func copySubElementPatchStrategy(field string, from, to map[string]interface{}) error { func copySubElementPatchStrategy(field string, from, to map[string]interface{}) error {
@ -199,7 +199,7 @@ func copySubElementPatchStrategy(field string, from, to map[string]interface{})
return nil return nil
} }
// MergePrimitive implements openapi // VisitReference implements openapi
func (v *arraySchemaVisitor) VisitReference(reference proto.Reference) { func (v *arraySchemaVisitor) VisitReference(reference proto.Reference) {
reference.SubSchema().Accept(v) reference.SubSchema().Accept(v)
if v.Err == nil { if v.Err == nil {
@ -212,7 +212,7 @@ type primitiveSchemaVisitor struct {
Result *proto.Primitive Result *proto.Primitive
} }
// MergePrimitive implements openapi // VisitPrimitive implements openapi
func (v *primitiveSchemaVisitor) VisitPrimitive(result *proto.Primitive) { func (v *primitiveSchemaVisitor) VisitPrimitive(result *proto.Primitive) {
v.Result = result v.Result = result
v.Kind = "primitive" v.Kind = "primitive"