Content-Length: 411166 | pFad | http://github.com/ruby-grape/grape/commit/4f6725a9fefb0b6ec72fb3cf9b576ce042a38bd4

76 Remove jsonapi related code (#2547) · ruby-grape/grape@4f6725a · GitHub
Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4f6725a

Browse files
authoredMar 15, 2025
Remove jsonapi related code (#2547)
* Remove specs related to jsonapi Remove jsonapi parser and error_formatter * Add CHANGELOG.md
1 parent 97f2413 commit 4f6725a

File tree

5 files changed

+1
-52
lines changed

5 files changed

+1
-52
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* [#2538](https://github.com/ruby-grape/grape/pull/2538): Fix validating nested json array params - [@mohammednasser-32](https://github.com/mohammednasser-32).
1515
* [#2543](https://github.com/ruby-grape/grape/pull/2543): Fix array allocation on mount - [@ericproulx](https://github.com/ericproulx).
1616
* [#2546](https://github.com/ruby-grape/grape/pull/2546): Fix middleware with keywords - [@ericproulx](https://github.com/ericproulx).
17+
* [#2547](https://github.com/ruby-grape/grape/pull/2547): Remove jsonapi related code - [@ericproulx](https://github.com/ericproulx).
1718
* Your contribution here.
1819

1920
### 2.3.0 (2025-02-08)

‎lib/grape/error_formatter/jsonapi.rb

-7
This file was deleted.

‎lib/grape/parser/jsonapi.rb

-7
This file was deleted.

‎spec/grape/middleware/exception_spec.rb

-21
Original file line numberDiff line numberDiff line change
@@ -162,27 +162,6 @@ def call(_env)
162162
end
163163
end
164164

165-
context do
166-
let(:running_app) { exception_app }
167-
let(:options) { { rescue_all: true, format: :jsonapi } }
168-
169-
it 'is possible to return errors in jsonapi format' do
170-
get '/'
171-
expect(last_response.body).to eq('{"error":"rain!"}')
172-
end
173-
end
174-
175-
context do
176-
let(:running_app) { error_hash_app }
177-
let(:options) { { rescue_all: true, format: :jsonapi } }
178-
179-
it 'is possible to return hash errors in jsonapi format' do
180-
get '/'
181-
expect(['{"error":"rain!","detail":"missing widget"}',
182-
'{"detail":"missing widget","error":"rain!"}']).to include(last_response.body)
183-
end
184-
end
185-
186165
context do
187166
let(:running_app) { exception_app }
188167
let(:options) { { rescue_all: true, format: :xml } }

‎spec/grape/middleware/formatter_spec.rb

-17
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,6 @@ def to_json(*_args)
3636
end
3737
end
3838

39-
context 'jsonapi' do
40-
let(:body) { { 'foos' => [{ 'bar' => 'baz' }] } }
41-
let(:env) do
42-
{ Rack::PATH_INFO => '/somewhere', Grape::Http::Headers::HTTP_ACCEPT => 'application/vnd.api+json' }
43-
end
44-
45-
it 'calls #to_json if the content type is jsonapi' do
46-
body.instance_eval do
47-
def to_json(*_args)
48-
'{"foos":[{"bar":"baz"}] }'
49-
end
50-
end
51-
r = Rack::MockResponse[*subject.call(env)]
52-
expect(r.body).to eq(Grape::Json.dump(body))
53-
end
54-
end
55-
5639
context 'xml' do
5740
let(:body) { +'string' }
5841
let(:env) do

0 commit comments

Comments
 (0)
Failed to load comments.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/ruby-grape/grape/commit/4f6725a9fefb0b6ec72fb3cf9b576ce042a38bd4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy