Convert the type name if primitive
@@ -480,6 +480,17 @@ func paramFor(at *expr.AttributeExpr, name, in string, required bool) *Parameter
func itemsFromExpr(at *expr.AttributeExpr) *Items {
items := &Items{Type: at.Type.Name()}
+ switch actual := at.Type.(type) {
+ case expr.Primitive:
+ switch actual.Kind() {
+ case expr.IntKind, expr.Int64Kind, expr.UIntKind, expr.UInt64Kind, expr.Int32Kind, expr.UInt32Kind:
+ items.Type = "integer"
+ case expr.Float32Kind, expr.Float64Kind:
+ items.Type = "number"
+ case expr.BytesKind:
+ items.Type = "string"
+ }
+ }
initValidations(at, items)
if expr.IsArray(at.Type) {
items.Items = itemsFromExpr(expr.AsArray(at.Type).ElemType)
