haveapi-go-client 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/haveapi-go-client.gemspec +1 -1
- data/lib/haveapi/go_client/version.rb +1 -1
- data/spec/integration/generator_spec.rb +24 -0
- data/template/action.go.erb +10 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b10b9259c694c973943eb57744455b88746275c842ac465c2ae8270d2047246
|
|
4
|
+
data.tar.gz: 53b78ee429af5cb6490e909a84de83e4b9c596531f45fa31c51784394d18caf7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95a8aa35195c569f6a4a90d494c1775946dfca559d14fa21101e5bc293b3eeaec8890693a4ef4428773db4204e676efd799d3a2cfbf89e204a57069ab5289748
|
|
7
|
+
data.tar.gz: 54b926ba7fdace81fff9e8ce48affebdc0006982e7ee9491f5c3730e57c293fd103b8cb5374e1b7e0384863a7aac8f025a509ef0685ff401ae1d524db2e93ad7
|
data/haveapi-go-client.gemspec
CHANGED
|
@@ -132,6 +132,30 @@ RSpec.describe HaveAPI::GoClient::Generator do
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
func TestEchoResourceOptionalAcceptsNil(t *testing.T) {
|
|
136
|
+
c := newValidationClient()
|
|
137
|
+
req := c.Test.EchoResourceOptional.Prepare()
|
|
138
|
+
in := req.NewInput()
|
|
139
|
+
in.SetProjectNil(true)
|
|
140
|
+
|
|
141
|
+
resp, err := req.Call()
|
|
142
|
+
if err != nil {
|
|
143
|
+
t.Fatalf("request failed: %v", err)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if !resp.Status {
|
|
147
|
+
t.Fatalf("request failed: %s", resp.Message)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if !resp.Output.ProjectNil {
|
|
151
|
+
t.Fatalf("expected ProjectNil=true, got false")
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if !resp.Output.ProjectProvided {
|
|
155
|
+
t.Fatalf("expected ProjectProvided=true, got false")
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
135
159
|
func TestEchoAcceptsValidInput(t *testing.T) {
|
|
136
160
|
c := newValidationClient()
|
|
137
161
|
req := c.Test.Echo.Prepare()
|
data/template/action.go.erb
CHANGED
|
@@ -562,11 +562,19 @@ func (resp *<%= action.go_response_type %>) CancelOperation() (*ActionActionStat
|
|
|
562
562
|
<% if action.http_method == 'GET' && action.has_input? -%>
|
|
563
563
|
func (inv *<%= action.go_invocation_type %>) convertInputToQueryParams(ret map[string]string) {
|
|
564
564
|
if inv.Input != nil {
|
|
565
|
-
<% action.input.parameters.each do |p| -%>
|
|
565
|
+
<% action.input.parameters.each do |p| -%>
|
|
566
566
|
if inv.IsParameterSelected("<%= p.go_name %>") {
|
|
567
|
+
<% if p.nillable? -%>
|
|
568
|
+
if inv.IsParameterNil("<%= p.go_name %>") {
|
|
569
|
+
ret["<%= action.input.namespace %>[<%= p.name %>]"] = ""
|
|
570
|
+
} else {
|
|
571
|
+
ret["<%= action.input.namespace %>[<%= p.name %>]"] = <% if p.go_in_type == 'string' %>inv.Input.<%= p.go_name %><% else %>convert<%= p.go_in_type.capitalize %>ToString(inv.Input.<%= p.go_name %>)<% end %>
|
|
572
|
+
}
|
|
573
|
+
<% else -%>
|
|
567
574
|
ret["<%= action.input.namespace %>[<%= p.name %>]"] = <% if p.go_in_type == 'string' %>inv.Input.<%= p.go_name %><% else %>convert<%= p.go_in_type.capitalize %>ToString(inv.Input.<%= p.go_name %>)<% end %>
|
|
575
|
+
<% end -%>
|
|
568
576
|
}
|
|
569
|
-
<% end -%>
|
|
577
|
+
<% end -%>
|
|
570
578
|
}
|
|
571
579
|
}
|
|
572
580
|
<% end -%>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: haveapi-go-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.27.
|
|
4
|
+
version: 0.27.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jakub Skokan
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.27.
|
|
18
|
+
version: 0.27.1
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.27.
|
|
25
|
+
version: 0.27.1
|
|
26
26
|
description: Go client generator
|
|
27
27
|
email:
|
|
28
28
|
- jakub.skokan@vpsfree.cz
|