mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 00:20:00 +08:00
(goctl): fix unresolved type if linked api imported (#3881)
This commit is contained in:
6
tools/goctl/pkg/parser/api/parser/testdata/base/request.api
vendored
Normal file
6
tools/goctl/pkg/parser/api/parser/testdata/base/request.api
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
syntax = "v1"
|
||||
|
||||
type Baz {
|
||||
Foo string `json:"foo"`
|
||||
Baz bool `json:"bar"`
|
||||
}
|
||||
10
tools/goctl/pkg/parser/api/parser/testdata/base/response.api
vendored
Normal file
10
tools/goctl/pkg/parser/api/parser/testdata/base/response.api
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
syntax = "v1"
|
||||
|
||||
import "request.api"
|
||||
type Bar {
|
||||
Foo int `json:"foo"`
|
||||
Bar bool `json:"bar"`
|
||||
Baz
|
||||
Qux map[string]string `json:"qux"`
|
||||
}
|
||||
|
||||
12
tools/goctl/pkg/parser/api/parser/testdata/link_import.api
vendored
Normal file
12
tools/goctl/pkg/parser/api/parser/testdata/link_import.api
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
syntax = "v1"
|
||||
|
||||
import "base/request.api"
|
||||
import "base/response.api"
|
||||
|
||||
type Foo {}
|
||||
|
||||
service demo {
|
||||
@handler handlerName
|
||||
get /users/id/:userId (Baz) returns (Bar)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user