swagger-dsl 2.0.0 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/swagger/dsl/components.rb +1 -1
- data/lib/swagger/dsl/config.rb +1 -1
- data/lib/swagger/dsl/rails_controller.rb +2 -2
- data/lib/swagger/dsl/serializer.rb +1 -1
- data/lib/swagger/dsl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6790d2ba00f115d8ae87d57231dbc739f387b11f2f020dfccf05116a41d7d45b
|
4
|
+
data.tar.gz: bdc77acc19218cad7242425a52ad4bcb0f6472b01840a919530d9d92fa4668a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 727ebd45aff0bb5c7e2eb1c9f908543e4f81be1a89582b3341d1616f631fde1e2f9737d71c243415053ad9eea2aa2bfc1973f0a5c79599efe9dfdf49c827d304
|
7
|
+
data.tar.gz: 622f74446aaa7d90e01eb3e07ed5e54c4abdd7078dc39345b363c05e443b79880afb5f50de44bdf99b8e74d6faffa5bc67dc809e157f54b3cbf527faf33e084b
|
data/CHANGELOG.md
CHANGED
data/lib/swagger/dsl/config.rb
CHANGED
@@ -13,7 +13,7 @@ module Swagger
|
|
13
13
|
)
|
14
14
|
@inject_key = inject_key
|
15
15
|
@default_dsl = default_dsl
|
16
|
-
@dsl_options ||= { reference_name: ->(name) { name.sub(/Serializer$/, "") } }
|
16
|
+
@dsl_options ||= { reference_name: ->(name) { name.sub(/Serializer$/, "").gsub(/::/, '-') } }
|
17
17
|
@eager = eager
|
18
18
|
@default_required = default_required
|
19
19
|
@lazy_define_paths = lazy_define_paths
|
@@ -17,8 +17,6 @@ module Swagger
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def swagger_define_path(action, format = :json, path: nil, method: nil, &block)
|
20
|
-
operation_id = "#{name}##{action}"
|
21
|
-
|
22
20
|
defaults = { action: action.to_s, controller: name.underscore.sub(/_controller$/, "") }
|
23
21
|
route = Rails.application.routes.routes.routes.find { |r| r.required_defaults == defaults }
|
24
22
|
unless route
|
@@ -29,6 +27,8 @@ module Swagger
|
|
29
27
|
if method.include?("|")
|
30
28
|
raise NotExactMatch, "route matched but verb can be #{verb}! specify :method key like 'get'."
|
31
29
|
end
|
30
|
+
operation_id = "#{name}##{action}.#{method}"
|
31
|
+
|
32
32
|
method = %w[put patch] if %w[put patch].include?(method)
|
33
33
|
path ||= route.path.spec.to_s.sub("(.:format)", "").gsub(/:(\w+)/, "{\\1}")
|
34
34
|
|
@@ -5,7 +5,7 @@ module Swagger
|
|
5
5
|
class DSL < Hash
|
6
6
|
module Serializer
|
7
7
|
def swagger(dsl: nil, &block)
|
8
|
-
name = self.name.sub(/Serializer$/, "")
|
8
|
+
name = self.name.sub(/Serializer$/, "").gsub(/::/, '-')
|
9
9
|
Swagger::DSL.current["components"]["schemas"][name] =
|
10
10
|
Swagger::DSL::JsonSchema.by(dsl).dsl(&block).merge(Swagger::DSL.current.config.inject_key => name)
|
11
11
|
end
|
data/lib/swagger/dsl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Narazaka
|
@@ -292,7 +292,7 @@ metadata:
|
|
292
292
|
homepage_uri: https://github.com/Narazaka/swagger-dsl
|
293
293
|
source_code_uri: https://github.com/Narazaka/swagger-dsl.git
|
294
294
|
changelog_uri: https://github.com/Narazaka/swagger-dsl/blob/master/CHANGELOG.md
|
295
|
-
documentation_uri: https://www.rubydoc.info/gems/swagger-dsl/2.0.
|
295
|
+
documentation_uri: https://www.rubydoc.info/gems/swagger-dsl/2.0.3
|
296
296
|
post_install_message:
|
297
297
|
rdoc_options: []
|
298
298
|
require_paths:
|