model_driven_api 3.1.11 → 3.1.13

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: bbaf42c9a62f9ebdc9cdf60633aeeb47ad39b11e9ebb9d20a94af73fea6c7213
4
- data.tar.gz: c56851d1ae81777a20cc1d7ea26c0a31fb2f349933df72e41f303b8194cc8da6
3
+ metadata.gz: b823fbfec58e3d2ed3fcfab93a4d1efbf71216d7f812f219a11f2f71842df4f5
4
+ data.tar.gz: f991ce102699d8b91e85ea996520bed2b1693a13b533a0971fed3f899b53fa44
5
5
  SHA512:
6
- metadata.gz: 67ff210a1024a027db62fdaad0091b52229b36d61753ee95c128930a3e4ea8bd127bc1bf8e61209a7aac9938b0c32fd768cdd8b72548adf7f8cc1336b41c95e6
7
- data.tar.gz: fc5a82329178979b349055efb02840708ee1d2df4a3ea37d19f9b317403a5d583a584c25f712e3a72c83d438d344d46fbcfb8762bfa573d40909f991e8716fc6
6
+ metadata.gz: 2fc75f3100b4021899d76b77c52210418ae0f832f97732d0edb8c53a037130394f025469f99d1bfba5943a3073c2d14b26858725d3828bcd44855e84804ad330
7
+ data.tar.gz: bf00ba029b9f15f73465ee1ab9aa59cffc6296f8b45392defd4d7b330498c2c4cae0c89007bbffc0114a95dc0a97cefc7643f56c42494f2c37fdd8c72f33ffbf
@@ -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.13".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.13
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-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_backend_commons