model_driven_api 3.1.11 → 3.1.12

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: bbaf42c9a62f9ebdc9cdf60633aeeb47ad39b11e9ebb9d20a94af73fea6c7213
4
- data.tar.gz: c56851d1ae81777a20cc1d7ea26c0a31fb2f349933df72e41f303b8194cc8da6
3
+ metadata.gz: 9d01d90d7ec2ea3620ce94fe7343c78b4a410b1a36be50727eee2eeeeaeef4c2
4
+ data.tar.gz: 5dfdd6800dba34d112febcdfc2e292f6c3b499fe8dcb886c24a8506baeb0b9a4
5
5
  SHA512:
6
- metadata.gz: 67ff210a1024a027db62fdaad0091b52229b36d61753ee95c128930a3e4ea8bd127bc1bf8e61209a7aac9938b0c32fd768cdd8b72548adf7f8cc1336b41c95e6
7
- data.tar.gz: fc5a82329178979b349055efb02840708ee1d2df4a3ea37d19f9b317403a5d583a584c25f712e3a72c83d438d344d46fbcfb8762bfa573d40909f991e8716fc6
6
+ metadata.gz: 5a00471f793e5cd7a829ddfedd4c2e947c63a7ecc727900f4b41bf4e6bb336aa19a2fcf504ecd81b3e2b861882924573a94e548592b8e0aae294e070db6a4177
7
+ data.tar.gz: bb79bf086d32464868aa24ee9508f5f9f14be291bab9ffadd5d7c307ebb3ab83eb7554804db505312464a1aefdd6afbab45a8ada6d3585813a5ec273d2f1ce7b
@@ -139,7 +139,7 @@ class Api::V2::InfoController < Api::V2::ApplicationController
139
139
  "post": {
140
140
  "summary": "Authenticate",
141
141
  "tags": ["Authentication"],
142
- "description": "Authenticate the user and return a JWT token in the header and the current user as body",
142
+ "description": "Authenticate the user and return a JWT token in the header and the current user as body.",
143
143
  "security": [
144
144
  "basicAuth": []
145
145
  ],
@@ -414,7 +414,7 @@ class Api::V2::InfoController < Api::V2::ApplicationController
414
414
  "/info/swagger": {
415
415
  "get": {
416
416
  "summary": "Swagger",
417
- "description": "Returns the Swagger",
417
+ "description": "Returns the self generated Swagger for all the models in the App.",
418
418
  "tags": ["Info"],
419
419
  "responses": {
420
420
  "200": {
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.1.11".freeze
2
+ VERSION = "3.1.12".freeze
3
3
  end
@@ -16,22 +16,11 @@ class NonCrudEndpoints
16
16
  def validate_request(params)
17
17
  # If there is no definition, return
18
18
  return if @definition.blank?
19
- # puts "Called Class is: #{self.class}"
20
- # puts "Which is son of: #{self.class.superclass}"
21
- # body_mandatory_keys = definition[:body].select { |k, v| v[:optional] == false }.keys
22
- # query_mandatory_keys = definition[:query].select { |k, v| v[:optional] == false }.keys
23
- # # Raise a ValidationError if the request does not match the definition
24
- # raise EndpointValidationError, "The verb \"#{params[:request_verb].presence || "No Verb Provided"}\" is not present in #{definition.keys.join(", ")}." if definition.keys.exclude? params[:request_verb]
25
- # # Raise an exception if the verb is put or post and the body keys in definition are not all present as params keys, both params and definition[:body] can have nested objects
26
- # raise EndpointValidationError, "The request body does not match the definition: in #{params[:request_verb]} requests all of the params must be present in definition. The body definition is #{definition[:body]}." if params[:request_verb] != "GET" && (body_mandatory_keys & params.keys) != body_mandatory_keys
27
- # # Raise an exception if the verb is put or post and the body keys in definition are not all present as params keys, both params and definition[:body] can have nested objects
28
- # raise EndpointValidationError, "The request query does not match the definition. The query definition is: #{definition[:query]}." if (query_mandatory_keys & params.keys) != query_mandatory_keys
29
- # # Rais if the type of the param is not the same as the definition
30
- # definition[:body].each do |k, v|
31
- # next if params[k].nil?
32
- # computed_type = get_type(params[k])
33
- # raise EndpointValidationError, "The type of the param #{k} is not the same as the definition. The definition is #{v[:type]} and the param is #{computed_type}." if v[:type] != computed_type
34
- # end
19
+
20
+ # Raise a ValidationError if the request does not match the definition of the verbs expected in the @definition hash
21
+ #raise EndpointValidationError, "The verb \"#{params[:request_verb].presence || "No Verb Provided"}\" is not present in #{@definition.keys.join(", ")}." if @definition.keys.exclude? params[:request_verb]
22
+ # Assuming @definition follows the openapi schema, we can check the request body and query parameters are correct
23
+
35
24
  end
36
25
 
37
26
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.11
4
+ version: 3.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-20 00:00:00.000000000 Z
11
+ date: 2024-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_backend_commons