modern 0.4.3 → 0.4.4
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 +4 -4
- data/lib/modern/doc_generator/open_api3/schemas.rb +7 -5
- data/lib/modern/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98b75246df0cf5705be087b807c14450b9c91e663729df7d0886ba4428287348
|
4
|
+
data.tar.gz: 59c973339a53b0d1d10157132cecbf5f46beb88901af2db6833f59ea19e4d6a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 833d34b65a46ec471edbbc12ce949477bfeef93c80e04f15c53dec67600f60f7c77f7d375ceae70803c4f47a019301e35d4bccaf8adcbdfe69fc197a4f521422
|
7
|
+
data.tar.gz: 53c57c0440bdbff95b26267124b95a6da80d75514eaa0bd2840bff93ff010b4152bc8c5c534b6ef4d829c6159adbbbe0d380a0f74278464be478979b3635595f
|
@@ -83,6 +83,8 @@ module Modern
|
|
83
83
|
|
84
84
|
if !registered_type.nil?
|
85
85
|
registered_type
|
86
|
+
elsif entry.is_a?(Class) && entry < Dry::Struct
|
87
|
+
_struct_ref(entry)
|
86
88
|
elsif entry.is_a?(Dry::Types::Sum::Constrained)
|
87
89
|
if entry.left.type.primitive == NilClass
|
88
90
|
# it's a nullable field
|
@@ -103,13 +105,13 @@ module Modern
|
|
103
105
|
# http://dry-rb.org/gems/dry-types/constraints/
|
104
106
|
|
105
107
|
_build_schema_value(ret, name_to_class, entry.type)
|
106
|
-
elsif entry.is_a?(Dry::Types::Default)
|
107
|
-
# this just unwraps the
|
108
|
+
elsif entry.is_a?(Dry::Types::Default) || entry.is_a?(Dry::Struct::Constructor) || entry.is_a?(Dry::Types::Constructor)
|
109
|
+
# this just unwraps the underlying value
|
108
110
|
_build_schema_value(ret, name_to_class, entry.type)
|
109
111
|
elsif entry.is_a?(Dry::Types::Definition)
|
110
112
|
primitive = entry.primitive
|
111
113
|
|
112
|
-
if primitive
|
114
|
+
if primitive < Dry::Struct
|
113
115
|
# TODO: make sure I'm understanding this correctly
|
114
116
|
# It feels weird to have to oneOf a $ref, but I can't figure out a
|
115
117
|
# syntax that doesn't require it.
|
@@ -120,9 +122,9 @@ module Modern
|
|
120
122
|
_struct_ref(primitive)
|
121
123
|
]
|
122
124
|
}
|
123
|
-
elsif primitive
|
125
|
+
elsif primitive < Hash
|
124
126
|
_build_object_from_schema(ret, name_to_class, entry.member_types)
|
125
|
-
elsif primitive
|
127
|
+
elsif primitive < Array
|
126
128
|
{
|
127
129
|
type: "array",
|
128
130
|
items: _build_schema_value(ret, name_to_class, entry.member)
|
data/lib/modern/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modern
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Ropple
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|