jsonapi-rb / jsonapi-rails

Rails gem for fast jsonapi-compliant APIs.
http://jsonapi-rb.org
MIT License
318 stars 62 forks source link

Change how renderer output is converted to JSON #133

Closed malcolmbaig closed 2 years ago

malcolmbaig commented 2 years ago

Context

Changes proposed in this pull request

Update the railtie to fix issues with the way renderer output is converted into a JSON string in the controller.

Cached and non-cached resources need slightly different handling, so make a logical check to tell the difference and use the appropriate method.

remear commented 2 years ago

Thanks for this!

phanle commented 2 years ago

@remear Can we release a new version of the gem to have this commit?

remear commented 2 years ago

My intent was to first fix the CI to ensure a stable release, of which there's a PR up I need to go review, then get this shipped. Sadly, I haven't had as much time to work on this as I'd like. I'll try to wrangle some time to get this out soon.

jkva commented 2 years ago

Seconding this - I'm dealing with the same JSON serialisation double encoding problem since I've tried to add caching, would love to see this released 😁