dox 3.0.1 → 3.0.2

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: 6808db0a1af26409a157247f58eaf3762e84adcf958602fce37c3807fce27c61
4
- data.tar.gz: 46a2cce3f39cb28e04d7ac178dd68e4cbf298d157a7ed4ea63b73eb6a38ed1fc
3
+ metadata.gz: 3140e2a29e4bcba21d0eae47f8db211014bd38928f4c6060c61e32f102d75f13
4
+ data.tar.gz: 304610a9e731bd9aefb4dc77999257a3743b762d3447c821a7503be7fa428dbc
5
5
  SHA512:
6
- metadata.gz: 6fb538b14a0f21199aeba7c8e5c5b1bcc5ed9c6eaf6815cf9897be9a9f771bc620863d3a0db69024ed4624b57eae92fd45034ffd7535fd83a1ce77d8367631f1
7
- data.tar.gz: 75e22a70a0362ba4f9c6abc6e645acf902473dfb526bdba2b83695adaf7e393944163511265d3b055d596b42c4a5732dd0bc82d53b31ef6fce044383c1a042dc
6
+ metadata.gz: 9d7a75174e726d53f0d38a8dbdcf96f69ae48a8311245cbe82834c4c6370a862d59b7612ec9ac27694ed10f6eaa7e19391a3373a59851ea0c917cf4d7e657662
7
+ data.tar.gz: 52ddf4123823ca1846e49bfacda241bd5a77c73ea4a0ffc4570e5580d84d47c79844052f64b38de19bf03fd3d3def39ab006cdfa081291a114e46c6e5a0eb497
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## v3.0.2
4
+
5
+ ### Bug fixes
6
+
7
+ - Rewind `rack.input` in `Dox::Formatters::Base` before reading the request body. Rack 3 dropped the implicit rewind on `Rack::Request#body`, so JSON, plain text, and XML request examples were empty when the body had already been consumed during request processing.
8
+ - Guard against a nil request body in `Dox::Formatters::Plain` and `Dox::Formatters::Xml`. Rack 3 returns `nil` instead of `StringIO("")` for bodyless requests.
9
+
3
10
  ## v3.0.1
4
11
 
5
12
  ### Bug fixes
@@ -4,6 +4,7 @@ module Dox
4
4
  def initialize(http_env)
5
5
  @http_env = http_env
6
6
  http_env_body = http_env.body
7
+ http_env_body.rewind if http_env_body.respond_to?(:rewind)
7
8
  @body = http_env_body.respond_to?(:read) ? http_env_body.read : http_env_body
8
9
  end
9
10
 
@@ -2,6 +2,8 @@ module Dox
2
2
  module Formatters
3
3
  class Plain < Dox::Formatters::Base
4
4
  def format
5
+ return '' if body.nil?
6
+
5
7
  return body if body.encoding == Encoding::UTF_8
6
8
 
7
9
  body.encode(Encoding::UTF_8)
@@ -2,6 +2,8 @@ module Dox
2
2
  module Formatters
3
3
  class Xml < Dox::Formatters::Base
4
4
  def format
5
+ return '' if body.nil?
6
+
5
7
  doc = REXML::Document.new(body)
6
8
  formatter = REXML::Formatters::Pretty.new
7
9
  formatter.compact = true
data/lib/dox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dox
2
- VERSION = '3.0.1'.freeze
2
+ VERSION = '3.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dox
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Melita Kokot
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2026-04-28 00:00:00.000000000 Z
13
+ date: 2026-06-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport