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: 159abe7b80c564e22c8558d37cf678e893af6438bf0953a777508e83710da3d3
4
- data.tar.gz: 6bae6fef3bd27f3c8f6ecfd04b6177e38857e2f3a4d97355451d9035eab3190c
3
+ metadata.gz: 6986755ba3d6b9b626b5544560e111b5ec57fb880775d3743f3fd10c82f56141
4
+ data.tar.gz: 93932c2a023ca4a9ee260fcac52472d3d32c299369c1f68a395110d51940d7b6
5
5
  SHA512:
6
- metadata.gz: 25ce91f9ebd0d83ced27a2c01a74b1103e6a6559d53f0166cc20a9b81e731c72746b04b8f86cbfccf4153815605220a5f6f13f7d19bea0a90c3dd9e979ca4b12
7
- data.tar.gz: c9a0e8e46a114d6b636c0e5f302f8cff2a0bbe7a1c89cfbe9e366d2ac6244e29d053f0fd5ee3778b0d3f1db51625ac597f32bce907cfde71baf4f6d8e1a3e6c9
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
- action_definition.merge!(summary: operation.description) if operation.description.present?
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(
@@ -1,3 +1,3 @@
1
1
  module RailsParamValidation
2
- VERSION = "0.4.9"
2
+ VERSION = "0.4.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-param-validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskar Kirmis