Skip to content

Commit

Permalink
Issue #225
Browse files Browse the repository at this point in the history
  • Loading branch information
ring-c committed Feb 23, 2020
1 parent 51c115b commit 12801d5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions property.go
Expand Up @@ -120,15 +120,19 @@ func getArrayPropertyName(pkgName string, astTypeArrayElt ast.Expr, parser *Pars
case *ast.SelectorExpr:
return parseFieldSelectorExpr(elt, parser, newArrayProperty)
case *ast.Ident:
name := TransToValidSchemeType(elt.Name)
name := elt.Name
if actualPrimitiveType, isCustomType := parser.CustomPrimitiveTypes[pkgName+"."+name]; isCustomType {
name = actualPrimitiveType
} else {
name = TransToValidSchemeType(elt.Name)
}
return propertyName{SchemaType: "array", ArrayType: name}
default:
name := TransToValidSchemeType(fmt.Sprintf("%s", astTypeArrayElt))
name := fmt.Sprintf("%s", astTypeArrayElt)
if actualPrimitiveType, isCustomType := parser.CustomPrimitiveTypes[pkgName+"."+name]; isCustomType {
name = actualPrimitiveType
} else {
name = TransToValidSchemeType(name)
}
return propertyName{SchemaType: "array", ArrayType: name}
}
Expand Down

0 comments on commit 12801d5

Please sign in to comment.