praxis 2.0.pre.34 → 2.0.pre.35

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: 907548a79ff385c164356d493d6ed808933534a37037d55fd3ffa446317c2e16
4
- data.tar.gz: a1bc7931b86f65d6091a5ec835cc1b7ea7dafa21ac13a5cf8a0fcafdfd00ba3f
3
+ metadata.gz: 44bb802f0b2f4372668de58fa4026c7b89ceaf6b24e59021efe0ac66add311c1
4
+ data.tar.gz: ce0ad5cdaa52001ec451467e865e8fc3c53102984a2aec3256393a51683b668d
5
5
  SHA512:
6
- metadata.gz: df103d23ba77341af3586865c294e4681ab4d3d8dcb89f5b78dc2f29c56e4edc84b755195e35965a0193635b9726cbfcfe96e1d13ee26597b10bd7fdc13011f4
7
- data.tar.gz: 927034f7434cd8a9e3f710d151d5fd04b92db0939d116c4951888c2c8837e8029db723e3c1aadd40efdb9930f05aada870c0c1291a07c126630c3d4c1784bcb4
6
+ metadata.gz: 8ba98db39d88023a2cf4b2573e83a87a018fa8e3c5959d757ca798f1b7d268b817cf8f2166ba3c04c1a60fc08804c025d31fb231ef2abea074bdadeccb74b6d0
7
+ data.tar.gz: 496473875489e1276471c09e5307c75502318153ab5de9d4debe0f0261e78fe3036bde69681323fd44431b5b849cd57c95213b697eef4804defa6596e4022bf0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## next
4
4
 
5
+ ## 2.0.pre.35
6
+ - Fix reported nullability property in OpenAPI generation. Looking at null: true | false isn't enough. The system needs to look at the default null behavior from Attributor, to properly ascertain if the exclusion of a 'null' option means nullable or not. This PR fixes this.
7
+
5
8
  ## 2.0.pre.34
6
9
  - Allow filtering, ordering and pagination to freely use any attributes (potentially deep ones) when no block for the definition is provided. When continuing to define the allowed fields from within the block, those would still be enforced.
7
10
  - Added the ability to easily control the hiding/displayability of MediaType attributes in responses.
@@ -374,6 +374,8 @@ module Praxis
374
374
 
375
375
  # Delegates the json-schema methods to the underlying attribute/member_type
376
376
  def self.as_json_schema(**args)
377
+ # TODO: Aren't we loosing the attribute options if we just call the type?? (e.g. description, etc)
378
+ # Also, we might want to add a 'title' for MTs, to be the class name (without prefixing) ...
377
379
  @attribute.type.as_json_schema(args)
378
380
  end
379
381
 
@@ -37,7 +37,10 @@ module Praxis
37
37
  end
38
38
  # Tag on OpenAPI specific requirements that aren't already added in the underlying JSON schema model
39
39
  # Nullable: (it seems we need to ensure there is a null option to the enum, if there is one)
40
- base_options[:nullable] = !base_options.delete(:null).nil? if base_options.key?(:null)
40
+ if base_options.key?(:null)
41
+ base_options[:nullable] = Attributor::Attribute::nullable_attribute?(base_options)
42
+ base_options.delete(:null)
43
+ end
41
44
 
42
45
  # We will dump schemas for mediatypes by simply creating a reference to the components' section
43
46
  if type < Attributor::Container && !(type < Praxis::Types::MultipartArray)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Praxis
4
- VERSION = '2.0.pre.34'
4
+ VERSION = '2.0.pre.35'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: praxis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.pre.34
4
+ version: 2.0.pre.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep M. Blanquer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-06-14 00:00:00.000000000 Z
12
+ date: 2023-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport