oas_core 0.5.1 → 0.5.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 +4 -4
- data/lib/oas_core/builders/operation_builder.rb +9 -17
- data/lib/oas_core/oas_route.rb +1 -3
- data/lib/oas_core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fee642cbd4064b2d7fb2685bb4ef2ff66163ec98349aabc2bbbe932c0370577b
|
4
|
+
data.tar.gz: b247d663506673b1c214eba736d70645ff83d6c93bf1c24df06c500590b08afd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b53a2347828d9842eaf1a8ff836c4049152c74130e0717f25573a840c07dd0e7cc5ca73dc171e962d1b6ff928548f87ff57b73be9c465227213c591753c18904
|
7
|
+
data.tar.gz: 5a6ade5f6ab47fb0ada36832f7615026238766fcec56dc068e74a2bccc2f85db19c636a395bfc0c366fe2c1fd9f128f2718f615d9516096d4e8d80ca5416be1a
|
@@ -31,8 +31,7 @@ module OasCore
|
|
31
31
|
|
32
32
|
def extract_summary(oas_route:)
|
33
33
|
summary_tag = oas_route.tags(:summary).first
|
34
|
-
summary_tag&.text || generate_crud_name(oas_route.method_name
|
35
|
-
oas_route.controller.downcase) || "#{oas_route.verb} #{oas_route.path}"
|
34
|
+
summary_tag&.text || generate_crud_name(oas_route.method_name) || "#{oas_route.verb} #{oas_route.path}"
|
36
35
|
end
|
37
36
|
|
38
37
|
def extract_operation_id(oas_route:)
|
@@ -74,21 +73,14 @@ module OasCore
|
|
74
73
|
end
|
75
74
|
end
|
76
75
|
|
77
|
-
def generate_crud_name(method
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
when :create
|
86
|
-
"Create new #{controller_name.singularize}"
|
87
|
-
when :update
|
88
|
-
"Update #{controller_name.singularize}"
|
89
|
-
when :destroy
|
90
|
-
"Delete #{controller_name.singularize}"
|
91
|
-
end
|
76
|
+
def generate_crud_name(method)
|
77
|
+
{
|
78
|
+
index: 'List',
|
79
|
+
show: 'View',
|
80
|
+
create: 'Create',
|
81
|
+
update: 'Update',
|
82
|
+
destroy: 'Delete'
|
83
|
+
}.fetch(method.to_sym)
|
92
84
|
end
|
93
85
|
end
|
94
86
|
end
|
data/lib/oas_core/oas_route.rb
CHANGED
@@ -2,9 +2,7 @@
|
|
2
2
|
|
3
3
|
module OasCore
|
4
4
|
class OasRoute
|
5
|
-
|
6
|
-
attr_accessor :controller_class, :controller_action, :controller, :controller_path, :method_name, :verb, :path,
|
7
|
-
:docstring, :source_string
|
5
|
+
attr_accessor :controller, :method_name, :verb, :path, :docstring, :source_string
|
8
6
|
attr_writer :tags
|
9
7
|
|
10
8
|
def initialize(attributes = {})
|
data/lib/oas_core/version.rb
CHANGED