Skip to content

Commit

Permalink
x-go-type: if no imports are specified, assume that the referred type…
Browse files Browse the repository at this point in the history
… is inside the same package

Signed-off-by: Emil Nikolov <[email protected]>
  • Loading branch information
e-nikolov committed May 1, 2019
1 parent 7c42b99 commit dd2bc62
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion generator/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ func knownDefGoType(def string, schema spec.Schema, clear func(string) string) (
}
xt := v.(map[string]interface{})
t := xt["type"].(string)
imp := xt["import"].(map[string]interface{})
impIface, ok := xt["import"]

if !ok {
return t, "", ""
}

imp := impIface.(map[string]interface{})
pkg := imp["package"].(string)
al, ok := imp["alias"]
var alias string
Expand Down

0 comments on commit dd2bc62

Please sign in to comment.