Skip to content

Commit

Permalink
A hacky way to skip validation of core API
Browse files Browse the repository at this point in the history
  • Loading branch information
Liujingfang1 committed Apr 16, 2018
1 parent f72f5c9 commit aa81c9d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/internal/codegen/parse/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ func (b *APIs) typeToJSONSchemaProps(t *types.Type, found sets.String, comments
case types.Builtin:
v, s = b.parsePrimitiveValidation(t, found, comments)
case types.Struct:
v, s = b.parseObjectValidation(t, found, comments)
if !strings.HasPrefix(t.Name.String(), "k8s.io") {
v, s = b.parseObjectValidation(t, found, comments)
}
case types.Map:
v, s = b.parseMapValidation(t, found, comments)
case types.Slice:
Expand Down Expand Up @@ -425,8 +427,10 @@ func (b *APIs) getMembers(t *types.Type, found sets.String) (map[string]v1beta1.
}
} else {
m, r := b.typeToJSONSchemaProps(member.Type, found, member.CommentLines)
members[name] = m
result[name] = r
if r != "" {
members[name] = m
result[name] = r
}
}
}
return members, result
Expand Down

0 comments on commit aa81c9d

Please sign in to comment.