Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(goctl): multi imports the api cause redeclared error
- Loading branch information
Showing
6 changed files
with
96 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import "importApi.api" | ||
|
||
type AnotherRequest { | ||
Name string `path:"name,options=you|me"` | ||
} | ||
|
||
type AnotherResponse { | ||
Message string `json:"message"` // message | ||
} | ||
|
||
@server( | ||
group: greet | ||
) | ||
service A-api { | ||
@handler AnotherImportHandler | ||
get /greet/from/another/:name(AnotherRequest) returns (AnotherResponse) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import "importApi.api" | ||
|
||
type Request struct { | ||
type Request { | ||
Name string `path:"name,options=you|me"` | ||
} | ||
|
||
type Response struct { | ||
type Response { | ||
Message string `json:"message"` // message | ||
} | ||
|
||
@server( | ||
group: greet | ||
) | ||
service A-api { | ||
@server( | ||
handler: GreetHandler | ||
) | ||
@handler GreetHandler | ||
get /greet/from/:name(Request) returns (Response) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
type ImportData struct { | ||
type ImportData { | ||
Name string `path:"name,options=you|me"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import "hasImportApi.api" | ||
import "anotherImportApi.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters