mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-19 05:55:19 +00:00
Fix golang clients string -> int64 unmarshale error (#217)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user