Skip to content

Commit 7cfd9de

Browse files
Merge pull request #559 from OneBusAway/release-please--branches--main--changes--next
release: 1.0.4
2 parents d318915 + 8a10197 commit 7cfd9de

File tree

10 files changed

+43
-22
lines changed

10 files changed

+43
-22
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.0.3"
2+
".": "1.0.4"
33
}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 1.0.4 (2025-06-05)
4+
5+
Full Changelog: [v1.0.3...v1.0.4](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.3...v1.0.4)
6+
7+
### Bug Fixes
8+
9+
* `to_sorbet_type` should not return branded types ([62260a5](https://github.com/OneBusAway/ruby-sdk/commit/62260a5beb28f955e636a8d8ae5054e81f0ddd1c))
10+
* default content-type for text in multi-part formdata uploads should be text/plain ([642d274](https://github.com/OneBusAway/ruby-sdk/commit/642d274c1f710e6ec592ee5aab241f322c8d1d4a))
11+
12+
13+
### Chores
14+
15+
* **internal:** version bump ([993b8ac](https://github.com/OneBusAway/ruby-sdk/commit/993b8ac7c60193de4157b5773da48ad76249564f))
16+
317
## 1.0.3 (2025-05-28)
418

519
Full Changelog: [v1.0.2...v1.0.3](https://github.com/OneBusAway/ruby-sdk/compare/v1.0.2...v1.0.3)

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
onebusaway-sdk (1.0.2)
14+
onebusaway-sdk (1.0.3)
1515
connection_pool
1616

1717
GEM

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
1717
<!-- x-release-please-start-version -->
1818

1919
```ruby
20-
gem "onebusaway-sdk", "~> 1.0.3"
20+
gem "onebusaway-sdk", "~> 1.0.4"
2121
```
2222

2323
<!-- x-release-please-end -->

lib/onebusaway_sdk/internal/type/enum.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,14 @@ def coerce(value, state:)
9191
#
9292
# @return [Object]
9393
def to_sorbet_type
94-
case values
94+
types = values.map { OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
95+
case types
9596
in []
9697
T.noreturn
97-
in [value, *_]
98-
T.all(OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(value), self)
98+
in [type]
99+
type
100+
else
101+
T.any(*types)
99102
end
100103
end
101104

lib/onebusaway_sdk/internal/type/union.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,14 @@ def dump(value, state:)
201201
#
202202
# @return [Object]
203203
def to_sorbet_type
204-
case (v = variants)
204+
types = variants.map { OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
205+
case types
205206
in []
206207
T.noreturn
208+
in [type]
209+
type
207210
else
208-
T.any(*v.map { OnebusawaySDK::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) })
211+
T.any(*types)
209212
end
210213
end
211214

lib/onebusaway_sdk/internal/util.rb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ class << self
497497
# @param closing [Array<Proc>]
498498
# @param content_type [String, nil]
499499
private def write_multipart_content(y, val:, closing:, content_type: nil)
500-
content_type ||= "application/octet-stream"
500+
content_line = "Content-Type: %s\r\n\r\n"
501501

502502
case val
503503
in OnebusawaySDK::FilePart
@@ -508,24 +508,21 @@ class << self
508508
content_type: val.content_type
509509
)
510510
in Pathname
511-
y << "Content-Type: #{content_type}\r\n\r\n"
511+
y << format(content_line, content_type || "application/octet-stream")
512512
io = val.open(binmode: true)
513513
closing << io.method(:close)
514514
IO.copy_stream(io, y)
515515
in IO
516-
y << "Content-Type: #{content_type}\r\n\r\n"
516+
y << format(content_line, content_type || "application/octet-stream")
517517
IO.copy_stream(val, y)
518518
in StringIO
519-
y << "Content-Type: #{content_type}\r\n\r\n"
519+
y << format(content_line, content_type || "application/octet-stream")
520520
y << val.string
521-
in String
522-
y << "Content-Type: #{content_type}\r\n\r\n"
523-
y << val.to_s
524521
in -> { primitive?(_1) }
525-
y << "Content-Type: text/plain\r\n\r\n"
522+
y << format(content_line, content_type || "text/plain")
526523
y << val.to_s
527524
else
528-
y << "Content-Type: application/json\r\n\r\n"
525+
y << format(content_line, content_type || "application/json")
529526
y << JSON.generate(val)
530527
end
531528
y << "\r\n"
@@ -563,6 +560,8 @@ class << self
563560

564561
# @api private
565562
#
563+
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
564+
#
566565
# @param body [Object]
567566
#
568567
# @return [Array(String, Enumerable<String>)]

lib/onebusaway_sdk/models.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ module OnebusawaySDK
1414
mod.constants.each do |name|
1515
case mod.const_get(name)
1616
in true | false
17-
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T.all(T::Boolean, mod) } }
17+
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } }
1818
mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
1919
in Integer
20-
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { T.all(Integer, mod) } }
20+
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } }
2121
mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
2222
in Float
23-
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { T.all(Float, mod) } }
23+
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } }
2424
mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
2525
in Symbol
26-
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { T.all(Symbol, mod) } }
26+
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } }
2727
mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
2828
else
2929
end

lib/onebusaway_sdk/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module OnebusawaySDK
4-
VERSION = "1.0.3"
4+
VERSION = "1.0.4"
55
end

rbi/onebusaway_sdk/internal/util.rbi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ module OnebusawaySDK
332332
end
333333

334334
# @api private
335+
#
336+
# https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
335337
sig do
336338
params(body: T.anything).returns([String, T::Enumerable[String]])
337339
end

0 commit comments

Comments
 (0)