diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2020-01-20 12:38:58 +0100 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2020-01-20 12:38:58 +0100 |
commit | e095944d454ba6ff09861d8732ddd8d25a2329de (patch) | |
tree | 10d4bb042048c33a10af8e7a06b5b57a53b9d57a /cmd | |
parent | e45d8802fd8de3602db630d75b370ff804000da9 (diff) |
Fix parsing default meta parameter
Change-Id: Ibfc1f97e299256809978cb84f1685aa6729e898c
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/binapi-generator/objects.go | 2 | ||||
-rw-r--r-- | cmd/binapi-generator/parse.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/cmd/binapi-generator/objects.go b/cmd/binapi-generator/objects.go index c4b645d..9325d03 100644 --- a/cmd/binapi-generator/objects.go +++ b/cmd/binapi-generator/objects.go @@ -65,7 +65,7 @@ type Field struct { // FieldMeta represents VPP binary API meta info for field type FieldMeta struct { Limit int - Default float64 + Default string } // Union represents VPP binary API union diff --git a/cmd/binapi-generator/parse.go b/cmd/binapi-generator/parse.go index 3867dd4..175fe50 100644 --- a/cmd/binapi-generator/parse.go +++ b/cmd/binapi-generator/parse.go @@ -468,7 +468,7 @@ func parseField(ctx *context, field *jsongo.JSONNode) (*Field, error) { case fieldMetaLimit: f.Meta.Limit = int(metaNode.Get().(float64)) case fieldMetaDefault: - f.Meta.Default = metaNode.Get().(float64) + f.Meta.Default = fmt.Sprint(metaNode.Get()) default: logrus.Warnf("unknown meta info (%s) for field (%s)", metaName, fieldName) } |