Fix parsing of integer label_type in yaml (#2276)

Fixes #2273
This commit is contained in:
Zachary Wasserman 2020-08-06 16:07:13 -07:00 committed by GitHub
parent 0619581b03
commit 34c4ce4ffb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,9 +121,9 @@ func (t LabelType) MarshalJSON() ([]byte, error) {
func (t *LabelType) UnmarshalJSON(b []byte) error {
switch string(b) {
case `"regular"`:
case `"regular"`, "0":
*t = LabelTypeRegular
case `"builtin"`:
case `"builtin"`, "1":
*t = LabelTypeBuiltIn
default:
return errors.Errorf("invalid LabelType: %s", string(b))