rspec-api-docs 0.14.0 → 1.0.0

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
- SHA1:
3
- metadata.gz: 40f9f19c014f36869e94593f06c1e37f283faf07
4
- data.tar.gz: 86be18b6bab2ffbdcb16855e556b26ee73961fba
2
+ SHA256:
3
+ metadata.gz: 429a0afbea16cd5fab5920685e2f16838f1a21db064866dd40b0eff090067fa7
4
+ data.tar.gz: 6183e6c6a015ceef0dc302c9228a1220fbd9db0f4dea53e198db118d84a3e902
5
5
  SHA512:
6
- metadata.gz: 08ef693bb6a343c1a10bec37a37bc54cfdb5d885e0287e3388ee5903ca2e0093900737ca816311deca1825d8704dd5e36aeeea9ac85d73148c7f59527a53d526
7
- data.tar.gz: 53a77a3c4557936d8c546cc1ba678250158b431c509bb35ae55325989259969aae8e118ea1009ca7939f402be9cd8912ecb26c74212e81882c0b387683b63b4e
6
+ metadata.gz: afaabc98ee7a6582c7c6e468db19f317ad9f52e9e808f8098aed2c1d7aba298749a7a24e4801825f7471a2d3a493c25c1e95606347837768dace45d983b400f1
7
+ data.tar.gz: 7c24db70cfe476134d29d9d0bbb526f860821dc06037529cc9834bc094991f59d45fbecdb2d1f86f0684b51d6b45520260091b8260fe6e59321e5d45c860c62b
@@ -6,7 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ## 0.14.0 - 2018-07-21
9
+ ## [1.0.0] - 2018-09-24
10
+
11
+ ### Changed
12
+ - The JSON response body will only be documented when the content type is `application/json` [#12] ([@2potatocakes])
13
+
14
+ ## [0.14.0] - 2018-07-21
10
15
 
11
16
  ### Added
12
17
  - This CHANGELOG file.
@@ -14,8 +19,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
14
19
  ### Changed
15
20
  - Include the request body in the generated JSON [#9] ([@2potatocakes])
16
21
 
17
- [Unreleased]: https://github.com/twe4ked/rspec-api-docs/compare/v0.14.0...HEAD
22
+ [Unreleased]: https://github.com/twe4ked/rspec-api-docs/compare/v1.0.0...HEAD
23
+ [1.0.0]: https://github.com/twe4ked/rspec-api-docs/compare/v0.14.0...v1.0.0
18
24
  [0.14.0]: https://github.com/twe4ked/rspec-api-docs/compare/v0.13.0...v0.14.0
19
25
 
20
26
  [#9]: https://github.com/twe4ked/rspec-api-docs/pull/9
27
+ [#12]: https://github.com/twe4ked/rspec-api-docs/pull/12
21
28
  [@2potatocakes]: https://github.com/2potatocakes
@@ -62,7 +62,7 @@ module RspecApiDocs
62
62
  request_content_type: request.content_type,
63
63
  response_status: response.status,
64
64
  response_status_text: response_status_text(response.status),
65
- response_body: response_body(response.body),
65
+ response_body: response_body(response.body, content_type: response.content_type),
66
66
  response_headers: response_headers(response.headers),
67
67
  response_content_type: response.content_type,
68
68
  }
@@ -132,8 +132,8 @@ module RspecApiDocs
132
132
  body_content.empty? ? nil : body_content
133
133
  end
134
134
 
135
- def response_body(body)
136
- unless body.empty?
135
+ def response_body(body, content_type:)
136
+ unless body.empty? || content_type != 'application/json'
137
137
  parsed_body = JSON.parse(body, symbolize_names: true)
138
138
  response_fields.each do |f|
139
139
  unless f.example.nil?
@@ -1,3 +1,3 @@
1
1
  module RspecApiDocs
2
- VERSION = '0.14.0'
2
+ VERSION = '1.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-api-docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Odin Dutton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-20 00:00:00.000000000 Z
11
+ date: 2018-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.5.1
181
+ rubygems_version: 2.7.6
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: Generate API documentation using RSpec