rails-param-validation 0.4.5 → 0.4.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45f982e8976d083082c29971f2b4deef210958452f473836f9436a1af1826636
|
4
|
+
data.tar.gz: 72ddb69843370c35b464b2aedb15ea65f377b86302c3f4e47ab4ea0226f13d38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed86c39b631c509f08e16f1f1fd054255ade51d98ff5ec10bc16c94a5deebd4ee1d01c07a9f7cfa5a3d15c5be1d1eab91a9460888cd8c5ab39010e62ed888e42
|
7
|
+
data.tar.gz: c500dd124663f480ce19832e3d7d766318b0b0be5c55a0f38ed71ebdae786a752a8b94fa3fb052a16e87542d103763546def758f968b21cee928371d3e6e2100
|
@@ -23,7 +23,7 @@ module RailsParamValidation
|
|
23
23
|
|
24
24
|
@param_definition.store_origin! class_name, method_name
|
25
25
|
RailsParamValidation.config.post_action_definition_hook.call(@param_definition)
|
26
|
-
@param_definition.finalize! class_name, method_name, (@base_paths || {}).fetch(self.name, self.name.underscore)
|
26
|
+
@param_definition.finalize! class_name, method_name, (@base_paths || {}).fetch(self.name, self.name.gsub(/Controller$/, "").underscore)
|
27
27
|
|
28
28
|
AnnotationManager.instance.annotate_method! self, name, :param_definition, @param_definition
|
29
29
|
@param_definition = nil
|
@@ -67,7 +67,19 @@ module RailsParamValidation
|
|
67
67
|
end.to_h
|
68
68
|
}
|
69
69
|
|
70
|
-
|
70
|
+
param_documentation = operation
|
71
|
+
.params
|
72
|
+
.filter { |_, v| v[:description].present? }
|
73
|
+
.map { |name, param| "* `#{name}`<br />#{param[:description]}" }
|
74
|
+
.join("\n\n")
|
75
|
+
|
76
|
+
if param_documentation.present?
|
77
|
+
param_documentation = "**Parameters**\n#{param_documentation}"
|
78
|
+
end
|
79
|
+
|
80
|
+
if param_documentation.present? || operation.description.present?
|
81
|
+
action_definition.merge!(description: "#{operation.description}\n\n#{param_documentation}".strip)
|
82
|
+
end
|
71
83
|
|
72
84
|
if body.any?
|
73
85
|
body_type_name = Types::Namespace.with_namespace(
|