Fix golang clients string -> int64 unmarshale error (#217)

This commit is contained in:
Janos Dobronszki
2021-09-27 12:12:33 +01:00
committed by GitHub
parent 6992fae6cf
commit 24c120896d
15 changed files with 42 additions and 37 deletions

View File

@@ -710,6 +710,7 @@ func schemaToType(language, serviceName, typeName string, schemas map[string]*op
if fieldUpperCase {
k = strcase.UpperCamelCase(k)
}
var typ string
// @todo clean up this piece of code by
// separating out type string marshaling and not
// repeating code
@@ -765,7 +766,7 @@ func schemaToType(language, serviceName, typeName string, schemas map[string]*op
case "string":
ret += k + fieldSeparator + stringType + fieldDelimiter
case "number":
typ := numberType
typ = numberType
switch v.Value.Format {
case "int32":
typ = int32Type
@@ -780,9 +781,13 @@ func schemaToType(language, serviceName, typeName string, schemas map[string]*op
case "boolean":
ret += k + fieldSeparator + boolType + fieldDelimiter
}
// go specific hack for lowercase son
// go specific hack for lowercase json
if language == "go" {
ret += " " + "`json:\"" + strcase.LowerCamelCase(k) + "\"`"
ret += " " + "`json:\"" + strcase.LowerCamelCase(k)
if typ == int64Type {
ret += ",string"
}
ret += "\"`"
}
if i < len(props) {