New Discussion

Notifications

You’re not receiving notifications from this thread.

rails API -> structuring JSON - best practices

1
Rails

Is there any better alternative to jbuilder?

Since fast_jsonapi is no longer maintained, what is the current 'best practice'? jb?

Hi!

Did you find a good solution for this? jbuilder is apparently quite unperformant and gems like active_model_serializer don't seem to be being maintained anymore, I assume that because there is some other way of doing it in 2024. How do people customize JSON API format nowadays?

In my case, I have a model with (simplifying) name, destination_address and destination_zip_code columns and I'd like my json to look like this: {"name":"foo","destination":{"address":"bar","zip_code":"baz"}}

Can anybody point me to the right direction?

Thank you!

Join the discussion
Create an account Log in

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.