Skip to content

Commit 82c1447

Browse files
committed
fix: update aep-lib-go
updating aep-lib-go, which contains a few fixes and new features (such as being able to dereference http-based schema refs).
1 parent a180146 commit 82c1447

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.22.3
44

55
require (
66
github.com/BurntSushi/toml v1.4.0
7-
github.com/aep-dev/aep-lib-go v0.0.0-20250226051706-6eab5b746243
7+
github.com/aep-dev/aep-lib-go v0.0.0-20250503191724-baef2924c8b5
88
github.com/spf13/cobra v1.8.1
99
github.com/stretchr/testify v1.9.0
1010
)
@@ -14,5 +14,6 @@ require (
1414
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1515
github.com/pmezard/go-difflib v1.0.0 // indirect
1616
github.com/spf13/pflag v1.0.5 // indirect
17+
golang.org/x/text v0.19.0 // indirect
1718
gopkg.in/yaml.v3 v3.0.1 // indirect
1819
)

go.sum

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
github.com/BurntSushi/toml v1.4.0 h1:kuoIxZQy2WRRk1pttg9asf+WVv6tWQuBNVmK8+nqPr0=
22
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
3-
github.com/aep-dev/aep-lib-go v0.0.0-20250226051706-6eab5b746243 h1:R0zh8mlKsE04B5MWcvs22xaeGzQrXWtRxqHemCh4jBY=
4-
github.com/aep-dev/aep-lib-go v0.0.0-20250226051706-6eab5b746243/go.mod h1:M+h1D6T2uIUPelmaEsJbjR6JhqKsTlPX3lxp25zQQsk=
3+
github.com/aep-dev/aep-lib-go v0.0.0-20250503191724-baef2924c8b5 h1:pPmCVHHuApQ+z4mJai7GGU4tgNO9MlHXr1Nj3h1zhqU=
4+
github.com/aep-dev/aep-lib-go v0.0.0-20250503191724-baef2924c8b5/go.mod h1:YWfg3gjAGpvwFJnEQl1JjBGd0evGBKobt5wU/QxV6pA=
55
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
66
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
77
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8+
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
9+
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
810
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
911
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
12+
github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww=
13+
github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg=
1014
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1115
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1216
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
@@ -16,7 +20,11 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
1620
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
1721
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
1822
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
23+
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
24+
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
1925
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
2026
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
27+
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
28+
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
2129
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
2230
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/service/resource_definition.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
1919
var parents []*string
2020

2121
i := 1
22-
for i < len(r.PatternElems)-1 {
23-
p := r.PatternElems[i]
22+
patternElems := r.PatternElems()
23+
for i < len(patternElems)-1 {
24+
p := patternElems[i]
2425
flagName := p[1 : len(p)-1]
2526
var flagValue string
2627
parents = append(parents, &flagValue)
@@ -31,9 +32,9 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
3132

3233
withPrefix := func(path string) string {
3334
pElems := []string{}
34-
for i, p := range r.PatternElems {
35+
for i, p := range patternElems {
3536
// last element, we assume this was handled by the caller.
36-
if i == len(r.PatternElems)-1 {
37+
if i == len(patternElems)-1 {
3738
continue
3839
}
3940
if i%2 == 0 {
@@ -46,10 +47,10 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
4647
return fmt.Sprintf("%s%s", prefix, path)
4748
}
4849

49-
if r.CreateMethod != nil {
50+
if r.Methods.Create != nil {
5051
use := "create [id]"
5152
args := cobra.ExactArgs(1)
52-
if !r.CreateMethod.SupportsUserSettableCreate {
53+
if !r.Methods.Create.SupportsUserSettableCreate {
5354
use = "create"
5455
args = cobra.ExactArgs(0)
5556
}
@@ -60,7 +61,7 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
6061
Args: args,
6162
Run: func(cmd *cobra.Command, args []string) {
6263
p := withPrefix("")
63-
if r.CreateMethod.SupportsUserSettableCreate {
64+
if r.Methods.Create.SupportsUserSettableCreate {
6465
id := args[0]
6566
p = withPrefix(fmt.Sprintf("?id=%s", id))
6667
}
@@ -78,7 +79,7 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
7879
c.AddCommand(createCmd)
7980
}
8081

81-
if r.GetMethod != nil {
82+
if r.Methods.Get != nil {
8283
getCmd := &cobra.Command{
8384
Use: "get [id]",
8485
Short: fmt.Sprintf("Get a %v", strings.ToLower(r.Singular)),
@@ -92,7 +93,7 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
9293
c.AddCommand(getCmd)
9394
}
9495

95-
if r.UpdateMethod != nil {
96+
if r.Methods.Update != nil {
9697

9798
updateArgs := map[string]interface{}{}
9899
updateCmd := &cobra.Command{
@@ -116,7 +117,7 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
116117
c.AddCommand(updateCmd)
117118
}
118119

119-
if r.DeleteMethod != nil {
120+
if r.Methods.Delete != nil {
120121

121122
deleteCmd := &cobra.Command{
122123
Use: "delete [id]",
@@ -131,7 +132,7 @@ func ExecuteResourceCommand(r *api.Resource, args []string) (*http.Request, stri
131132
c.AddCommand(deleteCmd)
132133
}
133134

134-
if r.ListMethod != nil {
135+
if r.Methods.List != nil {
135136

136137
listCmd := &cobra.Command{
137138
Use: "list",

0 commit comments

Comments
 (0)