model_driven_api 3.6.2 → 3.6.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 788fcac3981331c95571a795b70fbc57ffe19e805e6b980d786c68029c829715
4
- data.tar.gz: b5b1ff9dc311200a0c235c7395a8a5ff1474fdcc3f720d50df83a84e3a573c0d
3
+ metadata.gz: 18a706d49e3ccea7baed117aa8e3f7912c9a1480882e924a3675dc7b7133c459
4
+ data.tar.gz: 66ce008c9ca7f0f240da9c424336fd46fb151e9a8076db5f76b322bb79348583
5
5
  SHA512:
6
- metadata.gz: b8a2fdb915420044e79329167df9dd7caecd3e5265594490bad5bc584971e5905795d67c7cdc58a7fcd0c842f3ccd056e048e4874d68fa0b5b50dfd1d4bc9c2e
7
- data.tar.gz: 92a00f3c63f63186eefb3e0a0795df79c22f60e250f9b423a55d502141692e1a849024adf5a9382f474b680315aa7819fa5937d64138f1807fecccedd1249aee
6
+ metadata.gz: 965dfd5cf0fb7075b6cb6c3b21dc1ccbccf9b86e46f31c317fcf5248462eed6954e807dff3b9732a9b95e7ffcc1449fc892e7bfc21b7cba960c556f08a698d23
7
+ data.tar.gz: a1c2735b2a86a31b1918eb1f7366415a594dbc0f4b2ea6474f240f3534f274371f00692c173d9cbe73a0ab2f191321ed739e4edc73a2512fa1745fb7cab3adcf
@@ -597,7 +597,12 @@ class Api::V2::InfoController < Api::V2::ApplicationController
597
597
  v[:tags] = [d.model_name.name]
598
598
  end
599
599
 
600
- pivot["/#{model}/custom_action/#{action}"] = openapi_definition if openapi_definition
600
+ # Check if any HTTP method has path parameters with 'in: path', and if so, add {id} to the path
601
+ path = "/#{model}/custom_action/#{action}"
602
+ has_path_params = openapi_definition.any? { |_k, v| v.is_a?(Hash) && v[:parameters]&.any? { |p| p[:in] == 'path' } }
603
+ path += "/{id}" if has_path_params
604
+
605
+ pivot[path] = openapi_definition if openapi_definition
601
606
  end
602
607
  pivot["/#{model}/search"] = {
603
608
  # Complex queries are made using ranskac search via a post endpoint
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.6.2".freeze
2
+ VERSION = "3.6.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.2
4
+ version: 3.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni