stas / jsonapi.rb

Lightweight, simple and maintained JSON:API support for your next Ruby HTTP API.
MIT License
261 stars 57 forks source link

Issue 90 let code be in error response #95

Closed curtis741 closed 11 months ago

curtis741 commented 1 year ago

What is the current behavior?

code is not included when using the jsonapi_errors renderer

What is the new behavior?

code is included when using render jsonapi_errors

Checklist

I couldn't actually run the tests with a clean checkout from master on 2.0.1.

Also I don't see any tests for render jsonapi_errors? maybe I'm missing it...

Please make sure the following requirements are complete:

stas commented 1 year ago

Also I don't see any tests for render jsonapi_errors? maybe I'm missing it...

Please take a look at this one: https://github.com/stas/jsonapi.rb/blob/master/spec/errors_spec.rb

curtis741 commented 1 year ago

@stas I saw that file, all of those tests were testing the rendering of a resource that had an error. But there were no tests when you call jsonapi_error without a resource.

It's cool, I got a new test all setup so you've now got more test coverage.

curtis741 commented 1 year ago

@stas does this PR look good now?

curtis741 commented 11 months ago

@stas any feedback on this PR?

curtis741 commented 11 months ago

thanks @stas !