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: 7cac5e8e1680a9f3cbdce7cd511d39f4b95d0cddf9f2955e9bbbde3ff56daa5b
4
- data.tar.gz: a2f4422840a284a0658fa9c241bcda19edbcf7ad3927bc94a79ec38178b86e5b
3
+ metadata.gz: 45f982e8976d083082c29971f2b4deef210958452f473836f9436a1af1826636
4
+ data.tar.gz: 72ddb69843370c35b464b2aedb15ea65f377b86302c3f4e47ab4ea0226f13d38
5
5
  SHA512:
6
- metadata.gz: 5f1a29d5ed1039772184372c44073af3104cf4acc7d8f9299c561891dcb71f877ef937617fe91776919fd32021e7bc67e69a53f3e78c27e098520376d1ea2466
7
- data.tar.gz: e49a9586e8446164a580e4143f8af1dfaa2f04228d102e6ce00b1fb21bc9ddac36c8885b92df5064768439a136bf74d9ff8f1674787f4bf70b605f64ecd6ff6e
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
- 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.5"
2
+ VERSION = "0.4.6"
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.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskar Kirmis