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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb661e4d9dd5ab5b29d5d3b63af4b37a486848e0623a6e34ac41f53f0a0feebe
4
- data.tar.gz: 485e7d815e181bf209d541a0eb63c305acd79440cba6144812263b25108369de
3
+ metadata.gz: 8b10b9259c694c973943eb57744455b88746275c842ac465c2ae8270d2047246
4
+ data.tar.gz: 53b78ee429af5cb6490e909a84de83e4b9c596531f45fa31c51784394d18caf7
5
5
  SHA512:
6
- metadata.gz: c6ff55c1c5d592a79c5052df6ee2ea9311e0039b7d37068d9048d592ee2fe0b63913c9dca088387abf57a1937b015a75c4bf3c664a20aac9875f62e2d88236d3
7
- data.tar.gz: 06014c3863378caf51e02c6b6be0d919f740d6659974c185915ec89a8b0a4bd07434e625481599704ead36f3565e718fd0817462d6400462a0dcda01abd1097d
6
+ metadata.gz: 95a8aa35195c569f6a4a90d494c1775946dfca559d14fa21101e5bc293b3eeaec8890693a4ef4428773db4204e676efd799d3a2cfbf89e204a57069ab5289748
7
+ data.tar.gz: 54b926ba7fdace81fff9e8ce48affebdc0006982e7ee9491f5c3730e57c293fd103b8cb5374e1b7e0384863a7aac8f025a509ef0685ff401ae1d524db2e93ad7
@@ -18,5 +18,5 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'haveapi-client', '~> 0.27.0'
21
+ spec.add_dependency 'haveapi-client', '~> 0.27.1'
22
22
  end
@@ -1,5 +1,5 @@
1
1
  module HaveAPI
2
2
  module GoClient
3
- VERSION = '0.27.0'.freeze
3
+ VERSION = '0.27.1'.freeze
4
4
  end
5
5
  end
@@ -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()
@@ -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.0
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.0
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.0
25
+ version: 0.27.1
26
26
  description: Go client generator
27
27
  email:
28
28
  - jakub.skokan@vpsfree.cz