Skip to content

Commit

Permalink
fix test failure and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Liujingfang1 committed May 31, 2018
1 parent e2d7f7d commit 0fddc34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/internal/codegen/parse/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ func (b *APIs) parseArrayValidation(t *types.Type, found sets.String, comments [
Type: "array",
Items: &v1beta1.JSONSchemaPropsOrArray{Schema: &items},
}
// To represent byte arrays in the generated code, the property of the OpenAPI definition
// should have string as its type and byte as its format.
if t.Name.Name == "[]byte" {
props.Type = "string"
props.Format = "byte"
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ function test_crd_validation {
Alias string \`json:"alias"\`\
// +kubebuilder:validation:Enum=1,2,3\
Rank int \`json:"rank"\`\
Comment []byte \`json:"comment"\`\
Comment []byte \`json:"comment,omitempty"\`\
' pkg/apis/got/v1beta1/house_types.go

kubebuilder generate
Expand Down

0 comments on commit 0fddc34

Please sign in to comment.