praxis 2.0.pre.22 → 2.0.pre.23

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: fcf3359dc0ac9062c61efc934673d9bf5dfdda43e5abfbc9abc41d3030a7a00e
4
- data.tar.gz: 04ffe07b27222f714b8da5e756cc9e1733b76d066a9e1bf5a3d15358dc7e6662
3
+ metadata.gz: 222cfa107a8b45e1a7d397af277fc07448daa18849e13b5c115565d0e7db4996
4
+ data.tar.gz: 5fabb6000f848c062e813def28902ca002a33537ffe71a480daa7b84506a62b8
5
5
  SHA512:
6
- metadata.gz: f90af4ae85f4170a850d7d7637758c0c2d878271befa2fe437da8c994ac78657eebd28831bb0945a74ca48aa93a91d42e8b734fd70f3996984e427ad6850a7ae
7
- data.tar.gz: b8eaa60ce2ba599b94f4b844339df8501ca295f3e1efb9a0f5dd38b9c4551aa64f108ba3a28913d06a22748dab11fee5c4bd8f9cfb8d2e85b1c456fb3284a5b3
6
+ metadata.gz: d0221bd47825ca1a92828c819cb2016bcbecdcff3c7546a8ee8160ac71fce38d7f17e442bec31c9ffeae3d4af74a794cad056ff348709c60cf226f56d31e76bb
7
+ data.tar.gz: e1635b5788fbed05bbd8daa8198a75bcb6aa40aedef9e1a89504f874ba7f306e70876e8fc0fed7a5ca90c5111a1c8846b1fd0f414bc85909835038cd6a46feef
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## next
4
4
 
5
+ ## 2.0.pre.22
6
+ * Small fix in OpenAPI doc generation, which would detect and report more output types, even if they are only defined within the
7
+ children of anonymous types.
8
+
5
9
  ## 2.0.pre.22
6
10
  * Introduced Resource callbacks (an includeable concern). Callbacks allow you to define methods or blocks to be executed `before`, `after` or `around` any existing method in the resource. Class-level callbacks are defined with `self.xxxxx`. These methods will be executed within the instance of the resource (i.e., in the same context of the original) and must be defined with the same parameter signature. For around methods, only blocks can be used, and to call the original (inner) one, one needs to yield.
7
11
  * Introduced QueryMethods for resources (an includeable concern). QueryMethods expose handy querying methods (`.get`, `.get!`, `.all`, `.first` and `.last` ) which will reach into the underlying ORM (i.e., right now, only ActiveModelCompat is supported) to perform the desired loading of data (and subsequent wrapping of results in resource instances).
@@ -26,8 +26,19 @@ module Praxis
26
26
  # NOTE2: we should just create a $ref here unless it's an anon mediatype...
27
27
  return {} if type.is_a? SimpleMediaType # NOTE: skip if it's a SimpleMediaType?? ... is that correct?
28
28
 
29
- the_schema = if type.anonymous? || !(type < Praxis::MediaType) # Avoid referencing custom/simple Types? (i.e., just MTs)
30
- SchemaObject.new(info: type).dump_schema(shallow: false, allow_ref: false)
29
+ the_schema = if type.anonymous? || !(type < Praxis::MediaType)
30
+ # Avoid referencing custom/simple types (i.e. just MTs). As a corner case,
31
+ # dig into collections (which are anonymous) provided their member is not.
32
+ # This isn't germane to content attributes, but is necessary to ensure that we visit every
33
+ # non-anonymous type so that our emitted scheme covers the whole "surface area" of all
34
+ # actions.
35
+ underlying_type = type
36
+ underlying_type = underlying_type.member_type while underlying_type < Attributor::Collection
37
+
38
+ SchemaObject.new(info: type).dump_schema(
39
+ shallow: false,
40
+ allow_ref: type < Attributor::Collection && !underlying_type.anonymous?
41
+ )
31
42
  else
32
43
  SchemaObject.new(info: type).dump_schema(shallow: true, allow_ref: true)
33
44
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Praxis
4
- VERSION = '2.0.pre.22'
4
+ VERSION = '2.0.pre.23'
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.22
4
+ version: 2.0.pre.23
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: 2022-05-16 00:00:00.000000000 Z
12
+ date: 2022-07-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport