Skip to content

Commit

Permalink
improve unit tests (#981)
Browse files Browse the repository at this point in the history
* improve unit tests
* cleanup
* enable parallel testing
  • Loading branch information
ubogdan committed Aug 19, 2021
1 parent 497e6e2 commit 0bbefcf
Show file tree
Hide file tree
Showing 5 changed files with 858 additions and 239 deletions.
8 changes: 4 additions & 4 deletions operation.go
Expand Up @@ -632,9 +632,11 @@ func findTypeDef(importPath, typeName string) (*ast.TypeSpec, error) {

for i := range pkgInfo.Files {
for _, astDeclaration := range pkgInfo.Files[i].Decls {
if generalDeclaration, ok := astDeclaration.(*ast.GenDecl); ok && generalDeclaration.Tok == token.TYPE {
generalDeclaration, ok := astDeclaration.(*ast.GenDecl)
if ok && generalDeclaration.Tok == token.TYPE {
for _, astSpec := range generalDeclaration.Specs {
if typeSpec, ok := astSpec.(*ast.TypeSpec); ok {
typeSpec, ok := astSpec.(*ast.TypeSpec)
if ok {
if typeSpec.Name.String() == typeName {
return typeSpec, nil
}
Expand Down Expand Up @@ -771,8 +773,6 @@ func (operation *Operation) parseAPIObjectSchema(schemaType, refType string, ast
}

return spec.ArrayProperty(schema), nil
case PRIMITIVE:
return PrimitiveSchema(refType), nil
default:
return PrimitiveSchema(schemaType), nil
}
Expand Down

0 comments on commit 0bbefcf

Please sign in to comment.