jsonapi-resources 0.10.6 → 0.11.0.beta2
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/LICENSE.txt +1 -1
- data/README.md +39 -2
- data/lib/generators/jsonapi/controller_generator.rb +2 -0
- data/lib/generators/jsonapi/resource_generator.rb +2 -0
- data/lib/jsonapi/active_relation/adapters/join_left_active_record_adapter.rb +3 -2
- data/lib/jsonapi/active_relation/join_manager.rb +30 -18
- data/lib/jsonapi/active_relation/join_manager_v10.rb +305 -0
- data/lib/jsonapi/active_relation_retrieval.rb +885 -0
- data/lib/jsonapi/active_relation_retrieval_v09.rb +715 -0
- data/lib/jsonapi/{active_relation_resource.rb → active_relation_retrieval_v10.rb} +113 -135
- data/lib/jsonapi/acts_as_resource_controller.rb +49 -49
- data/lib/jsonapi/cached_response_fragment.rb +4 -2
- data/lib/jsonapi/callbacks.rb +2 -0
- data/lib/jsonapi/compiled_json.rb +2 -0
- data/lib/jsonapi/configuration.rb +35 -15
- data/lib/jsonapi/error.rb +2 -0
- data/lib/jsonapi/error_codes.rb +2 -0
- data/lib/jsonapi/exceptions.rb +2 -0
- data/lib/jsonapi/formatter.rb +2 -0
- data/lib/jsonapi/include_directives.rb +77 -19
- data/lib/jsonapi/link_builder.rb +2 -0
- data/lib/jsonapi/mime_types.rb +6 -10
- data/lib/jsonapi/naive_cache.rb +2 -0
- data/lib/jsonapi/operation.rb +2 -0
- data/lib/jsonapi/operation_result.rb +2 -0
- data/lib/jsonapi/paginator.rb +2 -0
- data/lib/jsonapi/path.rb +2 -0
- data/lib/jsonapi/path_segment.rb +4 -2
- data/lib/jsonapi/processor.rb +95 -140
- data/lib/jsonapi/relationship.rb +89 -35
- data/lib/jsonapi/{request_parser.rb → request.rb} +157 -164
- data/lib/jsonapi/resource.rb +7 -2
- data/lib/jsonapi/{basic_resource.rb → resource_common.rb} +187 -88
- data/lib/jsonapi/resource_controller.rb +2 -0
- data/lib/jsonapi/resource_controller_metal.rb +2 -0
- data/lib/jsonapi/resource_fragment.rb +17 -15
- data/lib/jsonapi/resource_identity.rb +6 -0
- data/lib/jsonapi/resource_serializer.rb +20 -4
- data/lib/jsonapi/resource_set.rb +36 -16
- data/lib/jsonapi/resource_tree.rb +191 -0
- data/lib/jsonapi/resources/railtie.rb +3 -1
- data/lib/jsonapi/resources/version.rb +3 -1
- data/lib/jsonapi/response_document.rb +4 -2
- data/lib/jsonapi/routing_ext.rb +4 -2
- data/lib/jsonapi/simple_resource.rb +13 -0
- data/lib/jsonapi-resources.rb +10 -4
- data/lib/tasks/check_upgrade.rake +3 -1
- metadata +47 -15
- data/lib/jsonapi/resource_id_tree.rb +0 -112
data/lib/jsonapi/resource_set.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module JSONAPI
|
2
4
|
# Contains a hash of resource types which contain a hash of resources, relationships and primary status keyed by
|
3
5
|
# resource id.
|
@@ -5,12 +7,24 @@ module JSONAPI
|
|
5
7
|
|
6
8
|
attr_reader :resource_klasses, :populated
|
7
9
|
|
8
|
-
def initialize(
|
10
|
+
def initialize(source, include_related = nil, options = nil)
|
9
11
|
@populated = false
|
10
|
-
|
12
|
+
tree = if source.is_a?(JSONAPI::ResourceTree)
|
13
|
+
source
|
14
|
+
elsif source.class.include?(JSONAPI::ResourceCommon)
|
15
|
+
JSONAPI::PrimaryResourceTree.new(resource: source, include_related: include_related, options: options)
|
16
|
+
elsif source.is_a?(Array)
|
17
|
+
JSONAPI::PrimaryResourceTree.new(resources: source, include_related: include_related, options: options)
|
18
|
+
end
|
19
|
+
|
20
|
+
if tree
|
21
|
+
@resource_klasses = flatten_resource_tree(tree)
|
22
|
+
end
|
11
23
|
end
|
12
24
|
|
13
|
-
def populate!(serializer, context,
|
25
|
+
def populate!(serializer, context, options)
|
26
|
+
return if @populated
|
27
|
+
|
14
28
|
# For each resource klass we want to generate the caching key
|
15
29
|
|
16
30
|
# Hash for collecting types and ids
|
@@ -21,9 +35,9 @@ module JSONAPI
|
|
21
35
|
# @type [Lookup[]]
|
22
36
|
lookups = []
|
23
37
|
|
24
|
-
|
25
38
|
# Step One collect all of the lookups for the cache, or keys that don't require cache access
|
26
39
|
@resource_klasses.each_key do |resource_klass|
|
40
|
+
missed_resource_ids[resource_klass] ||= []
|
27
41
|
|
28
42
|
serializer_config_key = serializer.config_key(resource_klass).gsub("/", "_")
|
29
43
|
context_json = resource_klass.attribute_caching_context(context).to_json
|
@@ -47,7 +61,13 @@ module JSONAPI
|
|
47
61
|
)
|
48
62
|
)
|
49
63
|
else
|
50
|
-
|
64
|
+
@resource_klasses[resource_klass].keys.each do |k|
|
65
|
+
if @resource_klasses[resource_klass][k][:resource].nil?
|
66
|
+
missed_resource_ids[resource_klass] << k
|
67
|
+
else
|
68
|
+
register_resource(resource_klass, @resource_klasses[resource_klass][k][:resource])
|
69
|
+
end
|
70
|
+
end
|
51
71
|
end
|
52
72
|
end
|
53
73
|
|
@@ -60,7 +80,6 @@ module JSONAPI
|
|
60
80
|
found_resources = {}
|
61
81
|
end
|
62
82
|
|
63
|
-
|
64
83
|
# Step Three collect the results and collect hit/miss stats
|
65
84
|
stats = {}
|
66
85
|
found_resources.each do |resource_klass, resources|
|
@@ -72,7 +91,6 @@ module JSONAPI
|
|
72
91
|
stats[resource_klass][:misses] += 1
|
73
92
|
|
74
93
|
# Collect misses
|
75
|
-
missed_resource_ids[resource_klass] ||= []
|
76
94
|
missed_resource_ids[resource_klass].push(id)
|
77
95
|
else
|
78
96
|
stats[resource_klass][:hits] ||= 0
|
@@ -89,14 +107,15 @@ module JSONAPI
|
|
89
107
|
|
90
108
|
# Step Four find any of the missing resources and join them into the result
|
91
109
|
missed_resource_ids.each_pair do |resource_klass, ids|
|
92
|
-
|
110
|
+
next if ids.empty?
|
111
|
+
|
112
|
+
find_opts = {context: context, fields: options[:fields]}
|
93
113
|
found_resources = resource_klass.find_to_populate_by_keys(ids, find_opts)
|
94
114
|
|
95
115
|
found_resources.each do |resource|
|
96
116
|
relationship_data = @resource_klasses[resource_klass][resource.id][:relationships]
|
97
117
|
|
98
118
|
if resource_klass.caching?
|
99
|
-
|
100
119
|
serializer_config_key = serializer.config_key(resource_klass).gsub("/", "_")
|
101
120
|
context_json = resource_klass.attribute_caching_context(context).to_json
|
102
121
|
context_b64 = JSONAPI.configuration.resource_cache_digest_function.call(context_json)
|
@@ -148,8 +167,8 @@ module JSONAPI
|
|
148
167
|
end
|
149
168
|
end
|
150
169
|
|
151
|
-
def
|
152
|
-
|
170
|
+
def flatten_resource_tree(resource_tree, flattened_tree = {})
|
171
|
+
resource_tree.fragments.each_pair do |resource_rid, fragment|
|
153
172
|
|
154
173
|
resource_klass = resource_rid.resource_klass
|
155
174
|
id = resource_rid.id
|
@@ -157,17 +176,18 @@ module JSONAPI
|
|
157
176
|
flattened_tree[resource_klass] ||= {}
|
158
177
|
|
159
178
|
flattened_tree[resource_klass][id] ||= {primary: fragment.primary, relationships: {}}
|
160
|
-
flattened_tree[resource_klass][id][:cache_id] ||= fragment.cache
|
179
|
+
flattened_tree[resource_klass][id][:cache_id] ||= fragment.cache if fragment.cache
|
180
|
+
flattened_tree[resource_klass][id][:resource] ||= fragment.resource if fragment.resource
|
161
181
|
|
162
182
|
fragment.related.try(:each_pair) do |relationship_name, related_rids|
|
163
|
-
flattened_tree[resource_klass][id][:relationships][relationship_name] ||=
|
183
|
+
flattened_tree[resource_klass][id][:relationships][relationship_name] ||= SortedSet.new
|
164
184
|
flattened_tree[resource_klass][id][:relationships][relationship_name].merge(related_rids)
|
165
185
|
end
|
166
186
|
end
|
167
187
|
|
168
|
-
|
169
|
-
|
170
|
-
|
188
|
+
related_resource_trees = resource_tree.related_resource_trees
|
189
|
+
related_resource_trees.try(:each_value) do |related_resource_tree|
|
190
|
+
flatten_resource_tree(related_resource_tree, flattened_tree)
|
171
191
|
end
|
172
192
|
|
173
193
|
flattened_tree
|
@@ -0,0 +1,191 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module JSONAPI
|
4
|
+
|
5
|
+
# A tree structure representing the resource structure of the requested resource(s). This is an intermediate structure
|
6
|
+
# used to keep track of the resources, by identity, found at different included relationships. It will be flattened and
|
7
|
+
# the resource instances will be fetched from the cache or the record store.
|
8
|
+
class ResourceTree
|
9
|
+
|
10
|
+
attr_reader :fragments, :related_resource_trees
|
11
|
+
|
12
|
+
# Gets the related Resource Id Tree for a relationship, and creates it first if it does not exist
|
13
|
+
#
|
14
|
+
# @param relationship [JSONAPI::Relationship]
|
15
|
+
#
|
16
|
+
# @return [JSONAPI::RelatedResourceTree] the new or existing resource id tree for the requested relationship
|
17
|
+
def get_related_resource_tree(relationship)
|
18
|
+
relationship_name = relationship.name.to_sym
|
19
|
+
@related_resource_trees[relationship_name] ||= RelatedResourceTree.new(relationship, self)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Adds each Resource Fragment to the Resources hash
|
23
|
+
#
|
24
|
+
# @param fragments [Hash]
|
25
|
+
# @param include_related [Hash]
|
26
|
+
#
|
27
|
+
# @return [null]
|
28
|
+
def add_resource_fragments(fragments, include_related)
|
29
|
+
fragments.each_value do |fragment|
|
30
|
+
add_resource_fragment(fragment, include_related)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Adds a Resource Fragment to the fragments hash
|
35
|
+
#
|
36
|
+
# @param fragment [JSONAPI::ResourceFragment]
|
37
|
+
# @param include_related [Hash]
|
38
|
+
#
|
39
|
+
# @return [null]
|
40
|
+
def add_resource_fragment(fragment, include_related)
|
41
|
+
init_included_relationships(fragment, include_related)
|
42
|
+
|
43
|
+
@fragments[fragment.identity] = fragment
|
44
|
+
end
|
45
|
+
|
46
|
+
# Adds each Resource to the fragments hash
|
47
|
+
#
|
48
|
+
# @param resource [Hash]
|
49
|
+
# @param include_related [Hash]
|
50
|
+
#
|
51
|
+
# @return [null]
|
52
|
+
def add_resources(resources, include_related)
|
53
|
+
resources.each do |resource|
|
54
|
+
add_resource_fragment(JSONAPI::ResourceFragment.new(resource.identity, resource: resource), include_related)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Adds a Resource to the fragments hash
|
59
|
+
#
|
60
|
+
# @param fragment [JSONAPI::ResourceFragment]
|
61
|
+
# @param include_related [Hash]
|
62
|
+
#
|
63
|
+
# @return [null]
|
64
|
+
def add_resource(resource, include_related)
|
65
|
+
add_resource_fragment(JSONAPI::ResourceFragment.new(resource.identity, resource: resource), include_related)
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
def init_included_relationships(fragment, include_related)
|
71
|
+
include_related && include_related.each_key do |relationship_name|
|
72
|
+
fragment.initialize_related(relationship_name)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def load_included(resource_klass, source_resource_tree, include_related, options)
|
77
|
+
include_related.try(:each_key) do |key|
|
78
|
+
relationship = resource_klass._relationship(key)
|
79
|
+
relationship_name = relationship.name.to_sym
|
80
|
+
|
81
|
+
find_related_resource_options = options.except(:filters, :sort_criteria, :paginator)
|
82
|
+
find_related_resource_options[:sort_criteria] = relationship.resource_klass.default_sort
|
83
|
+
find_related_resource_options[:cache] = resource_klass.caching?
|
84
|
+
|
85
|
+
related_fragments = resource_klass.find_included_fragments(source_resource_tree.fragments.values,
|
86
|
+
relationship,
|
87
|
+
find_related_resource_options)
|
88
|
+
|
89
|
+
related_resource_tree = source_resource_tree.get_related_resource_tree(relationship)
|
90
|
+
related_resource_tree.add_resource_fragments(related_fragments, include_related[key][:include_related])
|
91
|
+
|
92
|
+
# Now recursively get the related resources for the currently found resources
|
93
|
+
load_included(relationship.resource_klass,
|
94
|
+
related_resource_tree,
|
95
|
+
include_related[relationship_name][:include_related],
|
96
|
+
options)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
class PrimaryResourceTree < ResourceTree
|
102
|
+
|
103
|
+
# Creates a PrimaryResourceTree with no resources and no related ResourceTrees
|
104
|
+
def initialize(fragments: nil, resources: nil, resource: nil, include_related: nil, options: nil)
|
105
|
+
@fragments ||= {}
|
106
|
+
@related_resource_trees ||= {}
|
107
|
+
if fragments || resources || resource
|
108
|
+
if fragments
|
109
|
+
add_resource_fragments(fragments, include_related)
|
110
|
+
end
|
111
|
+
|
112
|
+
if resources
|
113
|
+
add_resources(resources, include_related)
|
114
|
+
end
|
115
|
+
|
116
|
+
if resource
|
117
|
+
add_resource(resource, include_related)
|
118
|
+
end
|
119
|
+
|
120
|
+
complete_includes!(include_related, options)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# Adds a Resource Fragment to the fragments hash
|
125
|
+
#
|
126
|
+
# @param fragment [JSONAPI::ResourceFragment]
|
127
|
+
# @param include_related [Hash]
|
128
|
+
#
|
129
|
+
# @return [null]
|
130
|
+
def add_resource_fragment(fragment, include_related)
|
131
|
+
fragment.primary = true
|
132
|
+
super(fragment, include_related)
|
133
|
+
end
|
134
|
+
|
135
|
+
def complete_includes!(include_related, options)
|
136
|
+
# ToDo: can we skip if more than one resource_klass found?
|
137
|
+
resource_klasses = Set.new
|
138
|
+
@fragments.each_key { |identity| resource_klasses << identity.resource_klass }
|
139
|
+
|
140
|
+
resource_klasses.each { |resource_klass| load_included(resource_klass, self, include_related, options) }
|
141
|
+
|
142
|
+
self
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
class RelatedResourceTree < ResourceTree
|
147
|
+
|
148
|
+
attr_reader :parent_relationship, :source_resource_tree
|
149
|
+
|
150
|
+
# Creates a RelatedResourceTree with no resources and no related ResourceTrees. A connection to the parent
|
151
|
+
# ResourceTree is maintained.
|
152
|
+
#
|
153
|
+
# @param parent_relationship [JSONAPI::Relationship]
|
154
|
+
# @param source_resource_tree [JSONAPI::ResourceTree]
|
155
|
+
#
|
156
|
+
# @return [JSONAPI::RelatedResourceTree] the new or existing resource id tree for the requested relationship
|
157
|
+
def initialize(parent_relationship, source_resource_tree)
|
158
|
+
@fragments ||= {}
|
159
|
+
@related_resource_trees ||= {}
|
160
|
+
|
161
|
+
@parent_relationship = parent_relationship
|
162
|
+
@parent_relationship_name = parent_relationship.name.to_sym
|
163
|
+
@source_resource_tree = source_resource_tree
|
164
|
+
end
|
165
|
+
|
166
|
+
# Adds a Resource Fragment to the fragments hash
|
167
|
+
#
|
168
|
+
# @param fragment [JSONAPI::ResourceFragment]
|
169
|
+
# @param include_related [Hash]
|
170
|
+
#
|
171
|
+
# @return [null]
|
172
|
+
def add_resource_fragment(fragment, include_related)
|
173
|
+
init_included_relationships(fragment, include_related)
|
174
|
+
|
175
|
+
fragment.related_from.each do |rid|
|
176
|
+
@source_resource_tree.fragments[rid].add_related_identity(parent_relationship.name, fragment.identity)
|
177
|
+
end
|
178
|
+
|
179
|
+
if @fragments[fragment.identity]
|
180
|
+
@fragments[fragment.identity].related_from.merge(fragment.related_from)
|
181
|
+
fragment.related.each_pair do |relationship_name, rids|
|
182
|
+
if rids
|
183
|
+
@fragments[fragment.identity].merge_related_identities(relationship_name, rids)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else
|
187
|
+
@fragments[fragment.identity] = fragment
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module JSONAPI
|
2
4
|
class ResponseDocument
|
3
5
|
attr_reader :serialized_results
|
@@ -17,7 +19,7 @@ module JSONAPI
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def has_errors?
|
20
|
-
@error_results.length
|
22
|
+
@error_results.length.positive? || @global_errors.length.positive?
|
21
23
|
end
|
22
24
|
|
23
25
|
def add_result(result, operation)
|
@@ -117,7 +119,7 @@ module JSONAPI
|
|
117
119
|
|
118
120
|
result.pagination_params.each_pair do |link_name, params|
|
119
121
|
if result.is_a?(JSONAPI::RelatedResourcesSetOperationResult)
|
120
|
-
relationship = result.source_resource.class.
|
122
|
+
relationship = result.source_resource.class._relationship(result._type)
|
121
123
|
unless relationship.exclude_link?(link_name)
|
122
124
|
link = serializer.link_builder.relationships_related_link(result.source_resource, relationship, query_params(params))
|
123
125
|
end
|
data/lib/jsonapi/routing_ext.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ActionDispatch
|
2
4
|
module Routing
|
3
5
|
class Mapper
|
@@ -222,7 +224,7 @@ module ActionDispatch
|
|
222
224
|
options = relationship.extract_options!.dup
|
223
225
|
|
224
226
|
relationship_name = relationship.first
|
225
|
-
relationship = source.
|
227
|
+
relationship = source._relationship(relationship_name)
|
226
228
|
|
227
229
|
relationship._routed = true
|
228
230
|
|
@@ -246,7 +248,7 @@ module ActionDispatch
|
|
246
248
|
options = relationship.extract_options!.dup
|
247
249
|
|
248
250
|
relationship_name = relationship.first
|
249
|
-
relationship = source.
|
251
|
+
relationship = source._relationship(relationship_name)
|
250
252
|
|
251
253
|
relationship._routed = true
|
252
254
|
|
data/lib/jsonapi-resources.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'jsonapi/resources/railtie'
|
2
4
|
require 'jsonapi/naive_cache'
|
3
5
|
require 'jsonapi/compiled_json'
|
4
|
-
require 'jsonapi/
|
5
|
-
require 'jsonapi/
|
6
|
+
require 'jsonapi/active_relation_retrieval'
|
7
|
+
require 'jsonapi/active_relation_retrieval_v09'
|
8
|
+
require 'jsonapi/active_relation_retrieval_v10'
|
9
|
+
require 'jsonapi/resource_common'
|
6
10
|
require 'jsonapi/resource'
|
11
|
+
require 'jsonapi/simple_resource'
|
7
12
|
require 'jsonapi/cached_response_fragment'
|
8
13
|
require 'jsonapi/response_document'
|
9
14
|
require 'jsonapi/acts_as_resource_controller'
|
@@ -25,7 +30,7 @@ require 'jsonapi/resource_serializer'
|
|
25
30
|
require 'jsonapi/exceptions'
|
26
31
|
require 'jsonapi/error'
|
27
32
|
require 'jsonapi/error_codes'
|
28
|
-
require 'jsonapi/
|
33
|
+
require 'jsonapi/request'
|
29
34
|
require 'jsonapi/processor'
|
30
35
|
require 'jsonapi/relationship'
|
31
36
|
require 'jsonapi/include_directives'
|
@@ -35,9 +40,10 @@ require 'jsonapi/callbacks'
|
|
35
40
|
require 'jsonapi/link_builder'
|
36
41
|
require 'jsonapi/active_relation/adapters/join_left_active_record_adapter'
|
37
42
|
require 'jsonapi/active_relation/join_manager'
|
43
|
+
require 'jsonapi/active_relation/join_manager_v10'
|
38
44
|
require 'jsonapi/resource_identity'
|
39
45
|
require 'jsonapi/resource_fragment'
|
40
|
-
require 'jsonapi/
|
46
|
+
require 'jsonapi/resource_tree'
|
41
47
|
require 'jsonapi/resource_set'
|
42
48
|
require 'jsonapi/path'
|
43
49
|
require 'jsonapi/path_segment'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rake'
|
2
4
|
require 'jsonapi-resources'
|
3
5
|
|
@@ -7,7 +9,7 @@ namespace :jsonapi do
|
|
7
9
|
task :check_upgrade => :environment do
|
8
10
|
Rails.application.eager_load!
|
9
11
|
|
10
|
-
resource_klasses = ObjectSpace.each_object(Class).select { |klass| klass
|
12
|
+
resource_klasses = ObjectSpace.each_object(Class).select { |klass| klass.include?(JSONAPI::ResourceCommon)}
|
11
13
|
|
12
14
|
puts "Checking #{resource_klasses.count} resources"
|
13
15
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Gebhardt
|
8
8
|
- Larry Gebhardt
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-09-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -129,34 +129,48 @@ dependencies:
|
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: hashie
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
type: :development
|
140
|
+
prerelease: false
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
132
146
|
- !ruby/object:Gem::Dependency
|
133
147
|
name: activerecord
|
134
148
|
requirement: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
152
|
+
version: '5.1'
|
139
153
|
type: :runtime
|
140
154
|
prerelease: false
|
141
155
|
version_requirements: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - ">="
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
159
|
+
version: '5.1'
|
146
160
|
- !ruby/object:Gem::Dependency
|
147
161
|
name: railties
|
148
162
|
requirement: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - ">="
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
166
|
+
version: '5.1'
|
153
167
|
type: :runtime
|
154
168
|
prerelease: false
|
155
169
|
version_requirements: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
171
|
- - ">="
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
173
|
+
version: '5.1'
|
160
174
|
- !ruby/object:Gem::Dependency
|
161
175
|
name: concurrent-ruby
|
162
176
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,6 +185,20 @@ dependencies:
|
|
171
185
|
- - ">="
|
172
186
|
- !ruby/object:Gem::Version
|
173
187
|
version: '0'
|
188
|
+
- !ruby/object:Gem::Dependency
|
189
|
+
name: sorted_set
|
190
|
+
requirement: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
type: :runtime
|
196
|
+
prerelease: false
|
197
|
+
version_requirements: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
174
202
|
description: A resource-centric approach to implementing the controllers, routes,
|
175
203
|
and serializers needed to support the JSON API spec.
|
176
204
|
email:
|
@@ -192,9 +220,11 @@ files:
|
|
192
220
|
- lib/jsonapi-resources.rb
|
193
221
|
- lib/jsonapi/active_relation/adapters/join_left_active_record_adapter.rb
|
194
222
|
- lib/jsonapi/active_relation/join_manager.rb
|
195
|
-
- lib/jsonapi/
|
223
|
+
- lib/jsonapi/active_relation/join_manager_v10.rb
|
224
|
+
- lib/jsonapi/active_relation_retrieval.rb
|
225
|
+
- lib/jsonapi/active_relation_retrieval_v09.rb
|
226
|
+
- lib/jsonapi/active_relation_retrieval_v10.rb
|
196
227
|
- lib/jsonapi/acts_as_resource_controller.rb
|
197
|
-
- lib/jsonapi/basic_resource.rb
|
198
228
|
- lib/jsonapi/cached_response_fragment.rb
|
199
229
|
- lib/jsonapi/callbacks.rb
|
200
230
|
- lib/jsonapi/compiled_json.rb
|
@@ -214,25 +244,27 @@ files:
|
|
214
244
|
- lib/jsonapi/path_segment.rb
|
215
245
|
- lib/jsonapi/processor.rb
|
216
246
|
- lib/jsonapi/relationship.rb
|
217
|
-
- lib/jsonapi/
|
247
|
+
- lib/jsonapi/request.rb
|
218
248
|
- lib/jsonapi/resource.rb
|
249
|
+
- lib/jsonapi/resource_common.rb
|
219
250
|
- lib/jsonapi/resource_controller.rb
|
220
251
|
- lib/jsonapi/resource_controller_metal.rb
|
221
252
|
- lib/jsonapi/resource_fragment.rb
|
222
|
-
- lib/jsonapi/resource_id_tree.rb
|
223
253
|
- lib/jsonapi/resource_identity.rb
|
224
254
|
- lib/jsonapi/resource_serializer.rb
|
225
255
|
- lib/jsonapi/resource_set.rb
|
256
|
+
- lib/jsonapi/resource_tree.rb
|
226
257
|
- lib/jsonapi/resources/railtie.rb
|
227
258
|
- lib/jsonapi/resources/version.rb
|
228
259
|
- lib/jsonapi/response_document.rb
|
229
260
|
- lib/jsonapi/routing_ext.rb
|
261
|
+
- lib/jsonapi/simple_resource.rb
|
230
262
|
- lib/tasks/check_upgrade.rake
|
231
263
|
homepage: https://github.com/cerebris/jsonapi-resources
|
232
264
|
licenses:
|
233
265
|
- MIT
|
234
266
|
metadata: {}
|
235
|
-
post_install_message:
|
267
|
+
post_install_message:
|
236
268
|
rdoc_options: []
|
237
269
|
require_paths:
|
238
270
|
- lib
|
@@ -243,12 +275,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
243
275
|
version: '2.3'
|
244
276
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
277
|
requirements:
|
246
|
-
- - "
|
278
|
+
- - ">"
|
247
279
|
- !ruby/object:Gem::Version
|
248
|
-
version:
|
280
|
+
version: 1.3.1
|
249
281
|
requirements: []
|
250
282
|
rubygems_version: 3.1.6
|
251
|
-
signing_key:
|
283
|
+
signing_key:
|
252
284
|
specification_version: 4
|
253
285
|
summary: Easily support JSON API in Rails.
|
254
286
|
test_files: []
|