rails-param-validation 0.4.9 → 0.4.10
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: 6986755ba3d6b9b626b5544560e111b5ec57fb880775d3743f3fd10c82f56141
|
4
|
+
data.tar.gz: 93932c2a023ca4a9ee260fcac52472d3d32c299369c1f68a395110d51940d7b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 900f628d863aab14082ce9948cda48189d60a101729a7709fd97588a1561ff54915e0832f92e6f6614ffe05e3b8cd1272468493da28e8e7371ec9016c161764c
|
7
|
+
data.tar.gz: 63d4fde71ceec6d935cbd7553af841de930a57d68caaefdf5d9642515a62e0bc4f7ae9238e0a437cda0b7ef1f4da7f4b72aba0079cb7f95360e197719c33b375
|
@@ -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(
|