-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Labels
area/goctlCategorizes issue or PR as related to goctl.Categorizes issue or PR as related to goctl.kind/bugSomething isn't workingSomething isn't working
Description
Describe the bug
When running the goctl api dart command with a specified API file which has embed struct, it fails with an error indicating a template execution failure. The error occurs when trying to call the getPropertyFromMember function on an empty string.
To Reproduce
Steps to reproduce the behavior, if applicable:
- The API is
syntax = "v1"
type (
Common {
ID int `json:"id"`
}
HealthReq {}
HealthRsp {
Common
}
)
@server (
prefix: /test
group: test
)
service main {
@handler GetSomeTestHandler
get /some-test (HealthReq) returns (HealthRsp)
}
-
Run
goctl api dart --hostname "xxx.com" --scheme "https" --api ./test.api --dir ./dark -
The error is
2025/04/12 11:53:22 template: dataTemplate:23:35: executing "dataTemplate" at <getPropertyFromMember .>: error calling getPropertyFromMember: cannot get property name of ""
Expected behavior
No error
Metadata
Metadata
Assignees
Labels
area/goctlCategorizes issue or PR as related to goctl.Categorizes issue or PR as related to goctl.kind/bugSomething isn't workingSomething isn't working