rswag-api 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f5a77aa4988d76dcd76d251288729514f07fc0e4cb28bb04a184d6be53001f6
4
- data.tar.gz: f13c18e015741835531ed97014fffb3d0ba647044ce948ea1d334852f4a64f0b
3
+ metadata.gz: a6129a4ac5fd490fc4b8eadc903858e47d338041c1a5fef949de4bc49cb0622d
4
+ data.tar.gz: db9641f4174bca12a823fff82561164fc979dfb4787faf422faa84a312c8299d
5
5
  SHA512:
6
- metadata.gz: b3548dbef713f3e93890d7198c70fe69b9c201081d2797a266add689e0a7a47a8f7a7b85feb38ae01da73abf222138bd387e69beb9cb9c3ef0f24b3a2cc50676
7
- data.tar.gz: 02a830a48706320dcdd8ffb3269793376ffb331353ef331a77c54e51a589d70c901f35b20fd3a95ef122e0b8e1d29410b6873be97d0f20f226d38ef58114bf5b
6
+ metadata.gz: f0969810068efc4e74d6a2ddd6e0a267ae70197515ca2bb582669f6b5f2ee19ca11f8efc0f6cd1dffbfd9b60b2634c3fdc5697fdcf8fa2b1ed899c2152c90648
7
+ data.tar.gz: ff2968039b935e68d8eaa2fae8f9469d4694435181d552f78df86c2004144025c755e18d8c96578f91e6a4190743cc7debcfa659bdf5ed020d55be117306a1e0
@@ -5,4 +5,4 @@ Example:
5
5
  rails generate rswag:api:install
6
6
 
7
7
  This will create:
8
- config/initializers/rswag-api.rb
8
+ config/initializers/rswag_api.rb
@@ -7,7 +7,7 @@ module Rswag
7
7
  source_root File.expand_path('../templates', __FILE__)
8
8
 
9
9
  def add_initializer
10
- template('rswag-api.rb', 'config/initializers/rswag-api.rb')
10
+ template('rswag_api.rb', 'config/initializers/rswag_api.rb')
11
11
  end
12
12
 
13
13
  def add_routes
@@ -1,7 +1,7 @@
1
1
  module Rswag
2
2
  module Api
3
3
  class Configuration
4
- attr_accessor :swagger_root, :swagger_filter
4
+ attr_accessor :swagger_root, :swagger_filter, :swagger_headers
5
5
 
6
6
  def resolve_swagger_root(env)
7
7
  path_params = env['action_dispatch.request.path_parameters'] || {}
@@ -19,11 +19,12 @@ module Rswag
19
19
  swagger = parse_file(filename)
20
20
  @config.swagger_filter.call(swagger, env) unless @config.swagger_filter.nil?
21
21
  mime = Rack::Mime.mime_type(::File.extname(path), 'text/plain')
22
+ headers = { 'Content-Type' => mime }.merge(@config.swagger_headers || {})
22
23
  body = unload_swagger(filename, swagger)
23
24
 
24
25
  return [
25
26
  '200',
26
- { 'Content-Type' => mime },
27
+ headers,
27
28
  [ body ]
28
29
  ]
29
30
  end
metadata CHANGED
@@ -1,14 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rswag-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richie Morris
8
+ - Greg Myers
9
+ - Jay Danielian
8
10
  autorequire:
9
11
  bindir: bin
10
12
  cert_chain: []
11
- date: 2019-11-02 00:00:00.000000000 Z
13
+ date: 2020-04-05 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: railties
@@ -19,7 +21,7 @@ dependencies:
19
21
  version: '3.1'
20
22
  - - "<"
21
23
  - !ruby/object:Gem::Version
22
- version: '6.1'
24
+ version: '7.0'
23
25
  type: :runtime
24
26
  prerelease: false
25
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +31,7 @@ dependencies:
29
31
  version: '3.1'
30
32
  - - "<"
31
33
  - !ruby/object:Gem::Version
32
- version: '6.1'
34
+ version: '7.0'
33
35
  description: Open up your API to the phenomenal Swagger ecosystem by exposing Swagger
34
36
  files, that describe your service, as JSON endpoints
35
37
  email:
@@ -42,12 +44,12 @@ files:
42
44
  - Rakefile
43
45
  - lib/generators/rswag/api/install/USAGE
44
46
  - lib/generators/rswag/api/install/install_generator.rb
45
- - lib/generators/rswag/api/install/templates/rswag-api.rb
47
+ - lib/generators/rswag/api/install/templates/rswag_api.rb
46
48
  - lib/rswag/api.rb
47
49
  - lib/rswag/api/configuration.rb
48
50
  - lib/rswag/api/engine.rb
49
51
  - lib/rswag/api/middleware.rb
50
- homepage: https://github.com/domaindrivendev/rswag
52
+ homepage: https://github.com/rswag/rswag
51
53
  licenses:
52
54
  - MIT
53
55
  metadata: {}
@@ -66,8 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
68
  - !ruby/object:Gem::Version
67
69
  version: '0'
68
70
  requirements: []
69
- rubyforge_project:
70
- rubygems_version: 2.7.8
71
+ rubygems_version: 3.0.6
71
72
  signing_key:
72
73
  specification_version: 4
73
74
  summary: A Rails Engine that exposes Swagger files as JSON endpoints