Skip to content

Commit 0bbefcf

Browse files
authored
improve unit tests (#981)
* improve unit tests * cleanup * enable parallel testing
1 parent 497e6e2 commit 0bbefcf

File tree

5 files changed

+858
-239
lines changed

5 files changed

+858
-239
lines changed

operation.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,11 @@ func findTypeDef(importPath, typeName string) (*ast.TypeSpec, error) {
632632

633633
for i := range pkgInfo.Files {
634634
for _, astDeclaration := range pkgInfo.Files[i].Decls {
635-
if generalDeclaration, ok := astDeclaration.(*ast.GenDecl); ok && generalDeclaration.Tok == token.TYPE {
635+
generalDeclaration, ok := astDeclaration.(*ast.GenDecl)
636+
if ok && generalDeclaration.Tok == token.TYPE {
636637
for _, astSpec := range generalDeclaration.Specs {
637-
if typeSpec, ok := astSpec.(*ast.TypeSpec); ok {
638+
typeSpec, ok := astSpec.(*ast.TypeSpec)
639+
if ok {
638640
if typeSpec.Name.String() == typeName {
639641
return typeSpec, nil
640642
}
@@ -771,8 +773,6 @@ func (operation *Operation) parseAPIObjectSchema(schemaType, refType string, ast
771773
}
772774

773775
return spec.ArrayProperty(schema), nil
774-
case PRIMITIVE:
775-
return PrimitiveSchema(refType), nil
776776
default:
777777
return PrimitiveSchema(schemaType), nil
778778
}

0 commit comments

Comments
 (0)