jsonapi_compliable 0.11.34 → 1.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +1 -2
- data/Rakefile +7 -3
- data/jsonapi_compliable.gemspec +7 -3
- data/lib/generators/jsonapi/resource_generator.rb +8 -79
- data/lib/generators/jsonapi/templates/application_resource.rb.erb +2 -1
- data/lib/generators/jsonapi/templates/controller.rb.erb +19 -64
- data/lib/generators/jsonapi/templates/resource.rb.erb +5 -47
- data/lib/generators/jsonapi/templates/resource_reads_spec.rb.erb +62 -0
- data/lib/generators/jsonapi/templates/resource_writes_spec.rb.erb +63 -0
- data/lib/jsonapi_compliable.rb +87 -18
- data/lib/jsonapi_compliable/adapters/abstract.rb +202 -45
- data/lib/jsonapi_compliable/adapters/active_record.rb +6 -130
- data/lib/jsonapi_compliable/adapters/active_record/base.rb +247 -0
- data/lib/jsonapi_compliable/adapters/active_record/belongs_to_sideload.rb +17 -0
- data/lib/jsonapi_compliable/adapters/active_record/has_many_sideload.rb +17 -0
- data/lib/jsonapi_compliable/adapters/active_record/has_one_sideload.rb +17 -0
- data/lib/jsonapi_compliable/adapters/active_record/inferrence.rb +12 -0
- data/lib/jsonapi_compliable/adapters/active_record/many_to_many_sideload.rb +30 -0
- data/lib/jsonapi_compliable/adapters/null.rb +177 -6
- data/lib/jsonapi_compliable/base.rb +33 -320
- data/lib/jsonapi_compliable/context.rb +16 -0
- data/lib/jsonapi_compliable/deserializer.rb +14 -39
- data/lib/jsonapi_compliable/errors.rb +227 -24
- data/lib/jsonapi_compliable/extensions/extra_attribute.rb +3 -1
- data/lib/jsonapi_compliable/filter_operators.rb +25 -0
- data/lib/jsonapi_compliable/hash_renderer.rb +57 -0
- data/lib/jsonapi_compliable/query.rb +190 -202
- data/lib/jsonapi_compliable/rails.rb +12 -6
- data/lib/jsonapi_compliable/railtie.rb +64 -0
- data/lib/jsonapi_compliable/renderer.rb +60 -0
- data/lib/jsonapi_compliable/resource.rb +35 -663
- data/lib/jsonapi_compliable/resource/configuration.rb +239 -0
- data/lib/jsonapi_compliable/resource/dsl.rb +138 -0
- data/lib/jsonapi_compliable/resource/interface.rb +32 -0
- data/lib/jsonapi_compliable/resource/polymorphism.rb +68 -0
- data/lib/jsonapi_compliable/resource/sideloading.rb +102 -0
- data/lib/jsonapi_compliable/resource_proxy.rb +127 -0
- data/lib/jsonapi_compliable/responders.rb +19 -0
- data/lib/jsonapi_compliable/runner.rb +25 -0
- data/lib/jsonapi_compliable/scope.rb +37 -79
- data/lib/jsonapi_compliable/scoping/extra_attributes.rb +29 -0
- data/lib/jsonapi_compliable/scoping/filter.rb +39 -58
- data/lib/jsonapi_compliable/scoping/filterable.rb +9 -14
- data/lib/jsonapi_compliable/scoping/paginate.rb +9 -3
- data/lib/jsonapi_compliable/scoping/sort.rb +16 -4
- data/lib/jsonapi_compliable/sideload.rb +221 -347
- data/lib/jsonapi_compliable/sideload/belongs_to.rb +34 -0
- data/lib/jsonapi_compliable/sideload/has_many.rb +16 -0
- data/lib/jsonapi_compliable/sideload/has_one.rb +9 -0
- data/lib/jsonapi_compliable/sideload/many_to_many.rb +24 -0
- data/lib/jsonapi_compliable/sideload/polymorphic_belongs_to.rb +108 -0
- data/lib/jsonapi_compliable/stats/payload.rb +4 -8
- data/lib/jsonapi_compliable/types.rb +172 -0
- data/lib/jsonapi_compliable/util/attribute_check.rb +88 -0
- data/lib/jsonapi_compliable/util/persistence.rb +29 -7
- data/lib/jsonapi_compliable/util/relationship_payload.rb +4 -4
- data/lib/jsonapi_compliable/util/render_options.rb +4 -32
- data/lib/jsonapi_compliable/util/serializer_attributes.rb +98 -0
- data/lib/jsonapi_compliable/util/validation_response.rb +15 -9
- data/lib/jsonapi_compliable/version.rb +1 -1
- metadata +105 -24
- data/lib/generators/jsonapi/field_generator.rb +0 -0
- data/lib/generators/jsonapi/templates/create_request_spec.rb.erb +0 -29
- data/lib/generators/jsonapi/templates/destroy_request_spec.rb.erb +0 -20
- data/lib/generators/jsonapi/templates/index_request_spec.rb.erb +0 -22
- data/lib/generators/jsonapi/templates/payload.rb.erb +0 -39
- data/lib/generators/jsonapi/templates/serializer.rb.erb +0 -25
- data/lib/generators/jsonapi/templates/show_request_spec.rb.erb +0 -19
- data/lib/generators/jsonapi/templates/update_request_spec.rb.erb +0 -33
- data/lib/jsonapi_compliable/adapters/active_record_sideloading.rb +0 -152
- data/lib/jsonapi_compliable/scoping/extra_fields.rb +0 -58
@@ -11,6 +11,10 @@ class JsonapiCompliable::Util::Persistence
|
|
11
11
|
@attributes = attributes
|
12
12
|
@relationships = relationships
|
13
13
|
@caller_model = caller_model
|
14
|
+
|
15
|
+
@attributes.each_pair do |key, value|
|
16
|
+
@attributes[key] = @resource.typecast(key, value, :writable)
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
20
|
# Perform the actual save logic.
|
@@ -37,6 +41,7 @@ class JsonapiCompliable::Util::Persistence
|
|
37
41
|
update_foreign_key_for_parents(parents)
|
38
42
|
|
39
43
|
persisted = persist_object(@meta[:method], @attributes)
|
44
|
+
persisted.instance_variable_set(:@__serializer_klass, @resource.serializer)
|
40
45
|
assign_temp_id(persisted, @meta[:temp_id])
|
41
46
|
|
42
47
|
associate_parents(persisted, parents)
|
@@ -65,7 +70,7 @@ class JsonapiCompliable::Util::Persistence
|
|
65
70
|
#
|
66
71
|
# This is not the case for HABTM, whose "foreign key" is a join table
|
67
72
|
def update_foreign_key(parent_object, attrs, x)
|
68
|
-
return if x[:sideload].type == :
|
73
|
+
return if x[:sideload].type == :many_to_many
|
69
74
|
|
70
75
|
if [:destroy, :disassociate].include?(x[:meta][:method])
|
71
76
|
attrs[x[:foreign_key]] = nil
|
@@ -77,8 +82,8 @@ class JsonapiCompliable::Util::Persistence
|
|
77
82
|
end
|
78
83
|
|
79
84
|
def update_foreign_type(attrs, x, null: false)
|
80
|
-
grouping_field = x[:sideload].parent.
|
81
|
-
attrs[grouping_field] = null ? nil : x[:sideload].
|
85
|
+
grouping_field = x[:sideload].parent.grouper.column_name
|
86
|
+
attrs[grouping_field] = null ? nil : x[:sideload].group_name
|
82
87
|
end
|
83
88
|
|
84
89
|
def update_foreign_key_for_parents(parents)
|
@@ -94,9 +99,21 @@ class JsonapiCompliable::Util::Persistence
|
|
94
99
|
parents.each do |x|
|
95
100
|
if x[:object] && object
|
96
101
|
if x[:meta][:method] == :disassociate
|
97
|
-
x[:sideload].
|
102
|
+
if x[:sideload].type == :belongs_to
|
103
|
+
x[:sideload].disassociate(object, x[:object])
|
104
|
+
else
|
105
|
+
x[:sideload].disassociate(x[:object], object)
|
106
|
+
end
|
98
107
|
else
|
99
|
-
x[:sideload].
|
108
|
+
if x[:sideload].type == :belongs_to
|
109
|
+
x[:sideload].associate(object, x[:object])
|
110
|
+
else
|
111
|
+
if [:has_many, :many_to_many].include?(x[:sideload].type)
|
112
|
+
x[:sideload].associate_all(object, Array(x[:object]))
|
113
|
+
else
|
114
|
+
x[:sideload].associate(x[:object], object)
|
115
|
+
end
|
116
|
+
end
|
100
117
|
end
|
101
118
|
end
|
102
119
|
end
|
@@ -108,11 +125,15 @@ class JsonapiCompliable::Util::Persistence
|
|
108
125
|
if x[:meta][:method] == :disassociate
|
109
126
|
x[:sideload].disassociate(object, x[:object])
|
110
127
|
elsif x[:meta][:method] == :destroy
|
111
|
-
if x[:sideload].type == :
|
128
|
+
if x[:sideload].type == :many_to_many
|
112
129
|
x[:sideload].disassociate(object, x[:object])
|
113
130
|
end # otherwise, no need to disassociate destroyed objects
|
114
131
|
else
|
115
|
-
|
132
|
+
if [:has_many, :many_to_many].include?(x[:sideload].type)
|
133
|
+
x[:sideload].associate_all(object, Array(x[:object]))
|
134
|
+
else
|
135
|
+
x[:sideload].associate(object, x[:object])
|
136
|
+
end
|
116
137
|
end
|
117
138
|
end
|
118
139
|
end
|
@@ -133,6 +154,7 @@ class JsonapiCompliable::Util::Persistence
|
|
133
154
|
[].tap do |processed|
|
134
155
|
iterate(except: [:polymorphic_belongs_to, :belongs_to]) do |x|
|
135
156
|
yield x
|
157
|
+
|
136
158
|
x[:object] = x[:sideload].resource
|
137
159
|
.persist_with_relationships(x[:meta], x[:attributes], x[:relationships], caller_model)
|
138
160
|
processed << x
|
@@ -21,7 +21,7 @@ module JsonapiCompliable
|
|
21
21
|
|
22
22
|
def iterate
|
23
23
|
payload.each_pair do |relationship_name, relationship_payload|
|
24
|
-
if sl = resource.sideload(relationship_name.to_sym)
|
24
|
+
if sl = resource.class.sideload(relationship_name.to_sym)
|
25
25
|
if should_yield?(sl.type)
|
26
26
|
if relationship_payload.is_a?(Array)
|
27
27
|
relationship_payload.each do |rp|
|
@@ -43,15 +43,15 @@ module JsonapiCompliable
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def payload_for(sideload, relationship_payload)
|
46
|
-
if sideload.
|
46
|
+
if sideload.polymorphic_parent?
|
47
47
|
type = relationship_payload[:meta][:jsonapi_type]
|
48
|
-
sideload = sideload.
|
48
|
+
sideload = sideload.child_for_type(type.to_sym)
|
49
49
|
end
|
50
50
|
relationship_payload[:meta][:method] ||= :update
|
51
51
|
|
52
52
|
{
|
53
53
|
sideload: sideload,
|
54
|
-
is_polymorphic:
|
54
|
+
is_polymorphic: sideload.polymorphic_child?,
|
55
55
|
primary_key: sideload.primary_key,
|
56
56
|
foreign_key: sideload.foreign_key,
|
57
57
|
attributes: relationship_payload[:attributes],
|
@@ -3,49 +3,21 @@ module JsonapiCompliable
|
|
3
3
|
# Generate the options we end up passing to {{http://jsonapi-rb.org jsonapi-rb}}
|
4
4
|
# @api private
|
5
5
|
class RenderOptions
|
6
|
-
def self.generate(
|
7
|
-
|
6
|
+
def self.generate(overrides = {})
|
7
|
+
|
8
|
+
|
8
9
|
|
9
|
-
fields = query_hash[:fields].dup
|
10
|
-
extra_fields = query_hash[:extra_fields]
|
11
10
|
|
12
|
-
# Ensure fields doesnt clobber extra fields
|
13
|
-
extra_fields.each do |k,v|
|
14
|
-
fields[k] = fields[k] + v if fields[k]
|
15
|
-
end
|
16
11
|
|
17
12
|
options = {}
|
18
|
-
options[:
|
19
|
-
options[:include] = query_hash[:include]
|
20
|
-
options[:jsonapi] = resolved
|
13
|
+
options[:include] = query.include_hash
|
21
14
|
options[:fields] = fields
|
22
15
|
options.merge!(overrides)
|
23
16
|
options[:meta] ||= {}
|
24
17
|
options[:expose] ||= {}
|
25
18
|
options[:expose][:extra_fields] = extra_fields
|
26
|
-
|
27
|
-
if object.respond_to?(:resolve_stats)
|
28
|
-
stats = object.resolve_stats
|
29
|
-
options[:meta][:stats] = stats unless stats.empty?
|
30
|
-
end
|
31
|
-
|
32
19
|
options
|
33
20
|
end
|
34
|
-
|
35
|
-
def self.inferrer
|
36
|
-
::Hash.new do |h, k|
|
37
|
-
names = k.to_s.split('::')
|
38
|
-
klass = names.pop
|
39
|
-
serializer_name = [*names, "Serializable#{klass}"].join('::')
|
40
|
-
serializer = serializer_name.safe_constantize
|
41
|
-
if serializer
|
42
|
-
h[k] = serializer
|
43
|
-
else
|
44
|
-
raise Errors::MissingSerializer.new(k, serializer_name)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
private_class_method :inferrer
|
49
21
|
end
|
50
22
|
end
|
51
23
|
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module JsonapiCompliable
|
2
|
+
module Util
|
3
|
+
class SerializerAttribute
|
4
|
+
def initialize(name, attr, resource, serializer, extra)
|
5
|
+
@name = name
|
6
|
+
@attr = attr
|
7
|
+
@resource = resource
|
8
|
+
@serializer = serializer
|
9
|
+
@extra = extra
|
10
|
+
end
|
11
|
+
|
12
|
+
def apply
|
13
|
+
return unless readable?
|
14
|
+
|
15
|
+
if @name == :id
|
16
|
+
@serializer.id(&@attr[:proc]) if @attr[:proc]
|
17
|
+
elsif @attr[:proc]
|
18
|
+
@serializer.send(_method, @name, serializer_options, &proc)
|
19
|
+
else
|
20
|
+
if @serializer.attribute_blocks[@name].nil?
|
21
|
+
@serializer.send(_method, @name, serializer_options, &proc)
|
22
|
+
else
|
23
|
+
inner = @serializer.attribute_blocks.delete(@name)
|
24
|
+
wrapped = wrap_proc(inner)
|
25
|
+
@serializer.send(_method, @name, serializer_options, &wrapped)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def _method
|
33
|
+
extra? ? :extra_attribute : :attribute
|
34
|
+
end
|
35
|
+
|
36
|
+
def extra?
|
37
|
+
!!@extra
|
38
|
+
end
|
39
|
+
|
40
|
+
def readable?
|
41
|
+
!!@attr[:readable]
|
42
|
+
end
|
43
|
+
|
44
|
+
def guard
|
45
|
+
_method = @attr[:readable]
|
46
|
+
instance = @resource.new
|
47
|
+
-> { instance.instance_eval(&_method) }
|
48
|
+
end
|
49
|
+
|
50
|
+
def guard?
|
51
|
+
@attr[:readable] != true
|
52
|
+
end
|
53
|
+
|
54
|
+
def serializer_options
|
55
|
+
{}.tap do |opts|
|
56
|
+
opts[:if] = guard if guard?
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def default_proc
|
61
|
+
type_name = @attr[:type]
|
62
|
+
_name = @name
|
63
|
+
_resource = @resource.new
|
64
|
+
->(_) {
|
65
|
+
_resource.typecast(_name, @object.send(_name), :readable)
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
def wrap_proc(inner)
|
70
|
+
type_name = @attr[:type]
|
71
|
+
->(serializer_instance = nil) {
|
72
|
+
type = JsonapiCompliable::Types[type_name]
|
73
|
+
type[:read][serializer_instance.instance_eval(&inner)]
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
def proc
|
78
|
+
@attr[:proc] ? wrap_proc(@attr[:proc]) : default_proc
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
class SerializerAttributes
|
83
|
+
def initialize(resource, attributes, extra = false)
|
84
|
+
@resource = resource
|
85
|
+
@serializer = resource.serializer
|
86
|
+
@attributes = attributes
|
87
|
+
@extra = extra
|
88
|
+
end
|
89
|
+
|
90
|
+
def apply
|
91
|
+
@attributes.each_pair do |name, attr|
|
92
|
+
SerializerAttribute
|
93
|
+
.new(name, attr, @resource, @serializer, @extra).apply
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -22,7 +22,7 @@ class JsonapiCompliable::Util::ValidationResponse
|
|
22
22
|
# Check to ensure no validation errors.
|
23
23
|
# @return [Boolean] did the persistence call succeed?
|
24
24
|
def success?
|
25
|
-
all_valid?(object,
|
25
|
+
all_valid?(object, relationships)
|
26
26
|
end
|
27
27
|
|
28
28
|
# @return [Array] the object and success state
|
@@ -39,34 +39,40 @@ class JsonapiCompliable::Util::ValidationResponse
|
|
39
39
|
|
40
40
|
private
|
41
41
|
|
42
|
+
def relationships
|
43
|
+
if @deserialized_params
|
44
|
+
@deserialized_params.relationships
|
45
|
+
else
|
46
|
+
{}
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
42
50
|
def valid_object?(object)
|
43
51
|
!object.respond_to?(:errors) ||
|
44
52
|
(object.respond_to?(:errors) && object.errors.blank?)
|
45
53
|
end
|
46
54
|
|
47
55
|
def all_valid?(model, deserialized_params)
|
48
|
-
|
49
|
-
|
56
|
+
valid = true
|
57
|
+
return false unless valid_object?(model)
|
50
58
|
deserialized_params.each_pair do |name, payload|
|
51
59
|
if payload.is_a?(Array)
|
52
60
|
related_objects = model.send(name)
|
53
|
-
related_objects.
|
61
|
+
related_objects.each do |r|
|
54
62
|
valid = valid_object?(r)
|
55
|
-
checks << valid
|
56
63
|
|
57
64
|
if valid
|
58
|
-
|
65
|
+
valid = all_valid?(r, deserialized_params[:relationships] || {})
|
59
66
|
end
|
60
67
|
end
|
61
68
|
else
|
62
69
|
related_object = model.send(name)
|
63
70
|
valid = valid_object?(related_object)
|
64
|
-
checks << valid
|
65
71
|
if valid
|
66
|
-
|
72
|
+
valid = all_valid?(related_object, deserialized_params[:relationships] || {})
|
67
73
|
end
|
68
74
|
end
|
69
75
|
end
|
70
|
-
|
76
|
+
valid
|
71
77
|
end
|
72
78
|
end
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi_compliable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Richmond
|
8
|
-
|
9
|
-
autorequire:
|
8
|
+
autorequire:
|
10
9
|
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2018-07-16 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: jsonapi-serializable
|
@@ -25,6 +24,34 @@ dependencies:
|
|
25
24
|
- - "~>"
|
26
25
|
- !ruby/object:Gem::Version
|
27
26
|
version: 0.3.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dry-types
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.13'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: jsonapi_errorable
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.9'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.9'
|
28
55
|
- !ruby/object:Gem::Dependency
|
29
56
|
name: activerecord
|
30
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,14 +92,14 @@ dependencies:
|
|
65
92
|
requirements:
|
66
93
|
- - "~>"
|
67
94
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
95
|
+
version: '1.12'
|
69
96
|
type: :development
|
70
97
|
prerelease: false
|
71
98
|
version_requirements: !ruby/object:Gem::Requirement
|
72
99
|
requirements:
|
73
100
|
- - "~>"
|
74
101
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
102
|
+
version: '1.12'
|
76
103
|
- !ruby/object:Gem::Dependency
|
77
104
|
name: rake
|
78
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,10 +142,43 @@ dependencies:
|
|
115
142
|
- - ">="
|
116
143
|
- !ruby/object:Gem::Version
|
117
144
|
version: '0'
|
118
|
-
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: activemodel
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - ">="
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '4.1'
|
152
|
+
- - "<"
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '6'
|
155
|
+
type: :development
|
156
|
+
prerelease: false
|
157
|
+
version_requirements: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '4.1'
|
162
|
+
- - "<"
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '6'
|
165
|
+
- !ruby/object:Gem::Dependency
|
166
|
+
name: jsonapi_spec_helpers
|
167
|
+
requirement: !ruby/object:Gem::Requirement
|
168
|
+
requirements:
|
169
|
+
- - ">="
|
170
|
+
- !ruby/object:Gem::Version
|
171
|
+
version: 1.0.alpha.1
|
172
|
+
type: :development
|
173
|
+
prerelease: false
|
174
|
+
version_requirements: !ruby/object:Gem::Requirement
|
175
|
+
requirements:
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: 1.0.alpha.1
|
179
|
+
description:
|
119
180
|
email:
|
120
181
|
- richmolj@gmail.com
|
121
|
-
- spasupuleti4@bloomberg.net
|
122
182
|
executables: []
|
123
183
|
extensions: []
|
124
184
|
extra_rdoc_files: []
|
@@ -205,44 +265,63 @@ files:
|
|
205
265
|
- gemfiles/rails_4.gemfile
|
206
266
|
- gemfiles/rails_5.gemfile
|
207
267
|
- jsonapi_compliable.gemspec
|
208
|
-
- lib/generators/jsonapi/field_generator.rb
|
209
268
|
- lib/generators/jsonapi/resource_generator.rb
|
210
269
|
- lib/generators/jsonapi/templates/application_resource.rb.erb
|
211
270
|
- lib/generators/jsonapi/templates/controller.rb.erb
|
212
|
-
- lib/generators/jsonapi/templates/create_request_spec.rb.erb
|
213
|
-
- lib/generators/jsonapi/templates/destroy_request_spec.rb.erb
|
214
|
-
- lib/generators/jsonapi/templates/index_request_spec.rb.erb
|
215
|
-
- lib/generators/jsonapi/templates/payload.rb.erb
|
216
271
|
- lib/generators/jsonapi/templates/resource.rb.erb
|
217
|
-
- lib/generators/jsonapi/templates/
|
218
|
-
- lib/generators/jsonapi/templates/
|
219
|
-
- lib/generators/jsonapi/templates/update_request_spec.rb.erb
|
272
|
+
- lib/generators/jsonapi/templates/resource_reads_spec.rb.erb
|
273
|
+
- lib/generators/jsonapi/templates/resource_writes_spec.rb.erb
|
220
274
|
- lib/jsonapi_compliable.rb
|
221
275
|
- lib/jsonapi_compliable/adapters/abstract.rb
|
222
276
|
- lib/jsonapi_compliable/adapters/active_record.rb
|
223
|
-
- lib/jsonapi_compliable/adapters/
|
277
|
+
- lib/jsonapi_compliable/adapters/active_record/base.rb
|
278
|
+
- lib/jsonapi_compliable/adapters/active_record/belongs_to_sideload.rb
|
279
|
+
- lib/jsonapi_compliable/adapters/active_record/has_many_sideload.rb
|
280
|
+
- lib/jsonapi_compliable/adapters/active_record/has_one_sideload.rb
|
281
|
+
- lib/jsonapi_compliable/adapters/active_record/inferrence.rb
|
282
|
+
- lib/jsonapi_compliable/adapters/active_record/many_to_many_sideload.rb
|
224
283
|
- lib/jsonapi_compliable/adapters/null.rb
|
225
284
|
- lib/jsonapi_compliable/base.rb
|
226
285
|
- lib/jsonapi_compliable/configuration.rb
|
286
|
+
- lib/jsonapi_compliable/context.rb
|
227
287
|
- lib/jsonapi_compliable/deserializer.rb
|
228
288
|
- lib/jsonapi_compliable/errors.rb
|
229
289
|
- lib/jsonapi_compliable/extensions/boolean_attribute.rb
|
230
290
|
- lib/jsonapi_compliable/extensions/extra_attribute.rb
|
231
291
|
- lib/jsonapi_compliable/extensions/temp_id.rb
|
292
|
+
- lib/jsonapi_compliable/filter_operators.rb
|
293
|
+
- lib/jsonapi_compliable/hash_renderer.rb
|
232
294
|
- lib/jsonapi_compliable/query.rb
|
233
295
|
- lib/jsonapi_compliable/rails.rb
|
296
|
+
- lib/jsonapi_compliable/railtie.rb
|
297
|
+
- lib/jsonapi_compliable/renderer.rb
|
234
298
|
- lib/jsonapi_compliable/resource.rb
|
299
|
+
- lib/jsonapi_compliable/resource/configuration.rb
|
300
|
+
- lib/jsonapi_compliable/resource/dsl.rb
|
301
|
+
- lib/jsonapi_compliable/resource/interface.rb
|
302
|
+
- lib/jsonapi_compliable/resource/polymorphism.rb
|
303
|
+
- lib/jsonapi_compliable/resource/sideloading.rb
|
304
|
+
- lib/jsonapi_compliable/resource_proxy.rb
|
305
|
+
- lib/jsonapi_compliable/responders.rb
|
306
|
+
- lib/jsonapi_compliable/runner.rb
|
235
307
|
- lib/jsonapi_compliable/scope.rb
|
236
308
|
- lib/jsonapi_compliable/scoping/base.rb
|
237
309
|
- lib/jsonapi_compliable/scoping/default_filter.rb
|
238
|
-
- lib/jsonapi_compliable/scoping/
|
310
|
+
- lib/jsonapi_compliable/scoping/extra_attributes.rb
|
239
311
|
- lib/jsonapi_compliable/scoping/filter.rb
|
240
312
|
- lib/jsonapi_compliable/scoping/filterable.rb
|
241
313
|
- lib/jsonapi_compliable/scoping/paginate.rb
|
242
314
|
- lib/jsonapi_compliable/scoping/sort.rb
|
243
315
|
- lib/jsonapi_compliable/sideload.rb
|
316
|
+
- lib/jsonapi_compliable/sideload/belongs_to.rb
|
317
|
+
- lib/jsonapi_compliable/sideload/has_many.rb
|
318
|
+
- lib/jsonapi_compliable/sideload/has_one.rb
|
319
|
+
- lib/jsonapi_compliable/sideload/many_to_many.rb
|
320
|
+
- lib/jsonapi_compliable/sideload/polymorphic_belongs_to.rb
|
244
321
|
- lib/jsonapi_compliable/stats/dsl.rb
|
245
322
|
- lib/jsonapi_compliable/stats/payload.rb
|
323
|
+
- lib/jsonapi_compliable/types.rb
|
324
|
+
- lib/jsonapi_compliable/util/attribute_check.rb
|
246
325
|
- lib/jsonapi_compliable/util/field_params.rb
|
247
326
|
- lib/jsonapi_compliable/util/hash.rb
|
248
327
|
- lib/jsonapi_compliable/util/hooks.rb
|
@@ -250,14 +329,15 @@ files:
|
|
250
329
|
- lib/jsonapi_compliable/util/persistence.rb
|
251
330
|
- lib/jsonapi_compliable/util/relationship_payload.rb
|
252
331
|
- lib/jsonapi_compliable/util/render_options.rb
|
332
|
+
- lib/jsonapi_compliable/util/serializer_attributes.rb
|
253
333
|
- lib/jsonapi_compliable/util/sideload.rb
|
254
334
|
- lib/jsonapi_compliable/util/validation_response.rb
|
255
335
|
- lib/jsonapi_compliable/version.rb
|
256
|
-
homepage:
|
336
|
+
homepage:
|
257
337
|
licenses:
|
258
338
|
- MIT
|
259
339
|
metadata: {}
|
260
|
-
post_install_message:
|
340
|
+
post_install_message:
|
261
341
|
rdoc_options: []
|
262
342
|
require_paths:
|
263
343
|
- lib
|
@@ -268,12 +348,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
268
348
|
version: '0'
|
269
349
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
270
350
|
requirements:
|
271
|
-
- - "
|
351
|
+
- - ">"
|
272
352
|
- !ruby/object:Gem::Version
|
273
|
-
version:
|
353
|
+
version: 1.3.1
|
274
354
|
requirements: []
|
275
|
-
|
276
|
-
|
355
|
+
rubyforge_project:
|
356
|
+
rubygems_version: 2.6.11
|
357
|
+
signing_key:
|
277
358
|
specification_version: 4
|
278
359
|
summary: Easily build jsonapi.org-compatible APIs
|
279
360
|
test_files: []
|