jsonapi_actions 0.2.2 → 0.3.0
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 +3 -2
- data/jsonapi_actions.gemspec +2 -2
- data/lib/jsonapi_actions.rb +1 -1
- data/lib/jsonapi_actions/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dd75b7ea62934cf27cc351d4327cf302af2ab1f5aed66d6d6075575e974d90b6
|
|
4
|
+
data.tar.gz: 56008596f5f59e8eb0640b2d0be4b81eed49dd6fdc7e0f08af5d9f10fc683687
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 709f2ae770a5efbfca5252997c866205a898eb85cc77dddc5517a936d99910e169f7767ecd1a677ec33b4aef30157236528260e9d629cb937578250fb489350b
|
|
7
|
+
data.tar.gz: 47e353f3fa687d0ee7a8463dfa412b110982bfcf10c2f294084603bce6f12d29ae937befb795549be5b3bc36f59ce2c9a2f85c4368a2c0a217a57c79159f93c5
|
data/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# JsonapiActions
|
|
2
2
|
|
|
3
3
|
Instantly create flexible API controllers that are compatible with [JSON:API](https://jsonapi.org/).
|
|
4
|
-
Utilize your existing [
|
|
4
|
+
Utilize your existing [JSONAPI::Serializer](https://github.com/jsonapi-serializer/jsonapi-serializer),
|
|
5
|
+
[FastJsonapi](https://github.com/Netflix/fast_jsonapi), or
|
|
5
6
|
[ActiveModel::Serializer](https://github.com/rails-api/active_model_serializers) serialization library, or bring your
|
|
6
7
|
own. Scope and authenticate with optional [Pundit](https://github.com/varvet/pundit) policies and/or Controller specific
|
|
7
8
|
methods.
|
|
@@ -138,7 +139,7 @@ end
|
|
|
138
139
|
```
|
|
139
140
|
|
|
140
141
|
### #json_response
|
|
141
|
-
Response data is formatted so that it can be rendered with `FastJsonapi
|
|
142
|
+
Response data is formatted so that it can be rendered with `JSONAPI::Serializer`, `FastJsonapi`, or `ActiveModel::Serializer`.
|
|
142
143
|
If you are using a different serializer, or would like to further change the response. Then you will need to override
|
|
143
144
|
`#response`, which defines the arguments for `render`.
|
|
144
145
|
|
data/jsonapi_actions.gemspec
CHANGED
|
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ["Kevin Pheasey"]
|
|
10
10
|
spec.email = ["kevin@kpsoftware.io"]
|
|
11
11
|
|
|
12
|
-
spec.summary = "Rails
|
|
13
|
-
spec.description = "Implement Rails
|
|
12
|
+
spec.summary = "Rails JSON:API Controller Actions"
|
|
13
|
+
spec.description = "Implement Rails JSON:API compliant controller actions."
|
|
14
14
|
spec.homepage = "https://github.com/kp-software/jsonapi_actions"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
data/lib/jsonapi_actions.rb
CHANGED
|
@@ -174,7 +174,7 @@ module JsonapiActions
|
|
|
174
174
|
end
|
|
175
175
|
|
|
176
176
|
def json_response(data, options = {})
|
|
177
|
-
if defined?(FastJsonapi)
|
|
177
|
+
if defined?(JSONAPI::Serializer) || defined?(FastJsonapi)
|
|
178
178
|
{
|
|
179
179
|
json: serializer(data).new(data, options.deep_merge(
|
|
180
180
|
include: include_param,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jsonapi_actions
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kevin Pheasey
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-06-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -92,7 +92,7 @@ dependencies:
|
|
|
92
92
|
- - "<"
|
|
93
93
|
- !ruby/object:Gem::Version
|
|
94
94
|
version: '2.0'
|
|
95
|
-
description: Implement Rails
|
|
95
|
+
description: Implement Rails JSON:API compliant controller actions.
|
|
96
96
|
email:
|
|
97
97
|
- kevin@kpsoftware.io
|
|
98
98
|
executables: []
|
|
@@ -124,7 +124,7 @@ homepage: https://github.com/kp-software/jsonapi_actions
|
|
|
124
124
|
licenses:
|
|
125
125
|
- MIT
|
|
126
126
|
metadata: {}
|
|
127
|
-
post_install_message:
|
|
127
|
+
post_install_message:
|
|
128
128
|
rdoc_options: []
|
|
129
129
|
require_paths:
|
|
130
130
|
- lib
|
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
140
140
|
version: '0'
|
|
141
141
|
requirements: []
|
|
142
142
|
rubygems_version: 3.0.8
|
|
143
|
-
signing_key:
|
|
143
|
+
signing_key:
|
|
144
144
|
specification_version: 4
|
|
145
|
-
summary: Rails
|
|
145
|
+
summary: Rails JSON:API Controller Actions
|
|
146
146
|
test_files: []
|