apiwork 0.6.1 → 0.7.1
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/README.md +7 -2
- data/lib/apiwork/adapter/serializer/error/default/api_builder.rb +6 -1
- data/lib/apiwork/adapter/standard/capability/writing/contract_builder.rb +1 -0
- data/lib/apiwork/api/base.rb +31 -0
- data/lib/apiwork/api/object.rb +16 -15
- data/lib/apiwork/contract/object/validator.rb +1 -1
- data/lib/apiwork/contract/object.rb +79 -77
- data/lib/apiwork/controller.rb +6 -2
- data/lib/apiwork/export/apiwork.rb +20 -0
- data/lib/apiwork/export/apiwork_mapper.rb +232 -0
- data/lib/apiwork/export/open_api.rb +2 -0
- data/lib/apiwork/export/registry.rb +1 -1
- data/lib/apiwork/export/sorbus.rb +1 -5
- data/lib/apiwork/export/type_script.rb +1 -4
- data/lib/apiwork/export/type_script_mapper.rb +12 -4
- data/lib/apiwork/export/zod.rb +0 -9
- data/lib/apiwork/export/zod_mapper.rb +22 -1
- data/lib/apiwork/export.rb +1 -0
- data/lib/apiwork/introspection/api/resource.rb +9 -0
- data/lib/apiwork/introspection/dump/param.rb +9 -10
- data/lib/apiwork/introspection/dump/resource.rb +3 -1
- data/lib/apiwork/introspection/dump/type.rb +15 -4
- data/lib/apiwork/introspection/enum.rb +9 -0
- data/lib/apiwork/introspection/param/array.rb +3 -0
- data/lib/apiwork/introspection/param/base.rb +11 -0
- data/lib/apiwork/introspection/param/binary.rb +3 -0
- data/lib/apiwork/introspection/param/boolean.rb +3 -0
- data/lib/apiwork/introspection/param/date.rb +3 -0
- data/lib/apiwork/introspection/param/date_time.rb +3 -0
- data/lib/apiwork/introspection/param/decimal.rb +3 -0
- data/lib/apiwork/introspection/param/integer.rb +3 -0
- data/lib/apiwork/introspection/param/number.rb +3 -0
- data/lib/apiwork/introspection/param/record.rb +3 -0
- data/lib/apiwork/introspection/param/string.rb +3 -0
- data/lib/apiwork/introspection/param/time.rb +3 -0
- data/lib/apiwork/introspection/param/uuid.rb +3 -0
- data/lib/apiwork/introspection/type.rb +9 -0
- data/lib/apiwork/issue.rb +1 -1
- data/lib/apiwork/object.rb +111 -103
- data/lib/apiwork/reference_generator.rb +43 -0
- data/lib/apiwork/representation/attribute.rb +87 -2
- data/lib/apiwork/representation/base.rb +4 -0
- data/lib/apiwork/version.rb +1 -1
- data/lib/apiwork.rb +4 -0
- metadata +4 -17
- data/lib/apiwork/export/builder_mapper.rb +0 -184
|
@@ -23,6 +23,9 @@ module Apiwork
|
|
|
23
23
|
# @api public
|
|
24
24
|
# The default for this param.
|
|
25
25
|
#
|
|
26
|
+
# Returns `nil` for both "no default" and "default is explicitly `nil`".
|
|
27
|
+
# Use {#default?} to distinguish these cases.
|
|
28
|
+
#
|
|
26
29
|
# @return [Object, nil]
|
|
27
30
|
def default
|
|
28
31
|
@dump[:default]
|
|
@@ -27,6 +27,9 @@ module Apiwork
|
|
|
27
27
|
# @api public
|
|
28
28
|
# The default for this param.
|
|
29
29
|
#
|
|
30
|
+
# Returns `nil` for both "no default" and "default is explicitly `nil`".
|
|
31
|
+
# Use {#default?} to distinguish these cases.
|
|
32
|
+
#
|
|
30
33
|
# @return [Object, nil]
|
|
31
34
|
def default
|
|
32
35
|
@dump[:default]
|
|
@@ -28,6 +28,9 @@ module Apiwork
|
|
|
28
28
|
# @api public
|
|
29
29
|
# The default for this param.
|
|
30
30
|
#
|
|
31
|
+
# Returns `nil` for both "no default" and "default is explicitly `nil`".
|
|
32
|
+
# Use {#default?} to distinguish these cases.
|
|
33
|
+
#
|
|
31
34
|
# @return [Object, nil]
|
|
32
35
|
def default
|
|
33
36
|
@dump[:default]
|
|
@@ -27,6 +27,9 @@ module Apiwork
|
|
|
27
27
|
# @api public
|
|
28
28
|
# The default for this param.
|
|
29
29
|
#
|
|
30
|
+
# Returns `nil` for both "no default" and "default is explicitly `nil`".
|
|
31
|
+
# Use {#default?} to distinguish these cases.
|
|
32
|
+
#
|
|
30
33
|
# @return [Object, nil]
|
|
31
34
|
def default
|
|
32
35
|
@dump[:default]
|
|
@@ -17,6 +17,9 @@ module Apiwork
|
|
|
17
17
|
# @api public
|
|
18
18
|
# The default for this param.
|
|
19
19
|
#
|
|
20
|
+
# Returns `nil` for both "no default" and "default is explicitly `nil`".
|
|
21
|
+
# Use {#default?} to distinguish these cases.
|
|
22
|
+
#
|
|
20
23
|
# @return [Object, nil]
|
|
21
24
|
def default
|
|
22
25
|
@dump[:default]
|
|
@@ -27,6 +27,9 @@ module Apiwork
|
|
|
27
27
|
# @api public
|
|
28
28
|
# The default for this param.
|
|
29
29
|
#
|
|
30
|
+
# Returns `nil` for both "no default" and "default is explicitly `nil`".
|
|
31
|
+
# Use {#default?} to distinguish these cases.
|
|
32
|
+
#
|
|
30
33
|
# @return [Object, nil]
|
|
31
34
|
def default
|
|
32
35
|
@dump[:default]
|
|
@@ -23,6 +23,9 @@ module Apiwork
|
|
|
23
23
|
# @api public
|
|
24
24
|
# The default for this param.
|
|
25
25
|
#
|
|
26
|
+
# Returns `nil` for both "no default" and "default is explicitly `nil`".
|
|
27
|
+
# Use {#default?} to distinguish these cases.
|
|
28
|
+
#
|
|
26
29
|
# @return [Object, nil]
|
|
27
30
|
def default
|
|
28
31
|
@dump[:default]
|
|
@@ -23,6 +23,9 @@ module Apiwork
|
|
|
23
23
|
# @api public
|
|
24
24
|
# The default for this param.
|
|
25
25
|
#
|
|
26
|
+
# Returns `nil` for both "no default" and "default is explicitly `nil`".
|
|
27
|
+
# Use {#default?} to distinguish these cases.
|
|
28
|
+
#
|
|
26
29
|
# @return [Object, nil]
|
|
27
30
|
def default
|
|
28
31
|
@dump[:default]
|
|
@@ -100,6 +100,14 @@ module Apiwork
|
|
|
100
100
|
@dump[:example]
|
|
101
101
|
end
|
|
102
102
|
|
|
103
|
+
# @api public
|
|
104
|
+
# The scope for this type.
|
|
105
|
+
#
|
|
106
|
+
# @return [String, nil]
|
|
107
|
+
def scope
|
|
108
|
+
@dump[:scope]
|
|
109
|
+
end
|
|
110
|
+
|
|
103
111
|
# @api public
|
|
104
112
|
# Whether this type is deprecated.
|
|
105
113
|
#
|
|
@@ -119,6 +127,7 @@ module Apiwork
|
|
|
119
127
|
discriminator: discriminator,
|
|
120
128
|
example: example,
|
|
121
129
|
extends: extends,
|
|
130
|
+
scope: scope,
|
|
122
131
|
shape: shape.transform_values(&:to_h),
|
|
123
132
|
type: type,
|
|
124
133
|
variants: variants.map(&:to_h),
|