fix(goctl)/new parser (#3834)

Co-authored-by: keson <keson@kesondeMacBook-Pro.local>
This commit is contained in:
kesonan
2024-01-11 23:50:53 +08:00
committed by GitHub
parent ffd2a78623
commit 7ba8adfc74
8 changed files with 171 additions and 5 deletions

View File

@@ -93,6 +93,12 @@ type (
NestDemoResp2 {
*Nest `json:"nest"`
}
RootReq{
}
RootResp{
}
)
@server (
@@ -124,6 +130,23 @@ service example {
prefix: /v1/v2
timeout: 100ms
)
service example {
@doc (
desc: "path demo"
)
@handler postPath
post /example/path (PostPathReq) returns (PostPathResp)
@handler root
post / (RootReq) returns (RootResp)
}
@server (
group: path2
middleware: Path
prefix: /v1/v3
timeout: 100ms
)
service example {
@doc (
desc: "path demo"

View File

@@ -1,4 +1,7 @@
service foo {
@handler root
get /
@handler bar
get /ping
@@ -7,6 +10,18 @@ service foo {
}
service bar {
@doc "bar"
@handler root
get / (Foo)
@doc "bar"
@handler root2
get / returns (Foo)
@doc "bar"
@handler root3
get / (Foo) returns (Bar)
@doc "bar"
@handler foo
get /foo/:bar (Foo)