Why not json:api? #316
Replies: 10 comments
-
There are a few reasons, but the biggest one is the fact that there are so many gems out there such as jsonapi-serializers and jsonapi-resources. |
Beta Was this translation helpful? Give feedback.
-
I do agree with @okuramasafumi. And somewhat related I've opened a PR to add jsonapi-serializers to the benchmark, in case you wonder how it compares speed wise with alba: #109 |
Beta Was this translation helpful? Give feedback.
-
If Alba supports JSON:API, it becomes easier to implement different styles of APIs (JSON:API compatible one and flat one) with only Alba. This could be a killer feature for some. The interface would be something like: class JSONAPIResource
include Alba::Resource
jsonapi!
end
class FlatResource
include Alba::Resource
end
# This resource follows JSON:API convention
class FooResource < JSONAPIResource
attributes :id
# ...
end
# This resource follows no convention
class BarResource < FlatResource
attributes :id
# ...
end |
Beta Was this translation helpful? Give feedback.
-
Hi there, Unfortunately I could not find any reference on how to configure this gem to generate JSONAPI payload, but more importantly, I'd prefer to not have But I'm more than happy to add alba to the benchmarks we're maintaining as soon you have the JSONAPI support: I appreciate your support in having this confusion sorted out. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Hi, I'd like to mention a few things. |
Beta Was this translation helpful? Give feedback.
-
Please proceed.
JSONAPI was not designed and not optimized to generate some other specs. The goal of the project is to produce a valid JSONAPI spec and be as fast as possible at it. This project is claiming that it is:
And then you claim you provide support for JSONAPI, but you don't. Next, folks recommend switching away from My goal with raising this issue is simply to clarify the current situation, if you want to keep using I hope it all makes sense. |
Beta Was this translation helpful? Give feedback.
-
The way these two are presented, it appears they are meant to be related arguments, but unless I'm misunderstanding I don't believe they are. Where do you see the claim that it supports JSON:API? I see a few places where it says it doesn't and explains why, but I don't see anything that says it does.
Are there others mentioning it outside of this comment?
There is a I do sympathize with your position, though, to be clear. My own serializer implementation, |
Beta Was this translation helpful? Give feedback.
-
@jgaskins thanks for sharing. I already said I have no problem keeping things the way they are, as long as it's clarified this is not JSONAPI spec. I appreciate everyone sharing their opinions, but this is merely a request to clarify things and remove any confusions. @okuramasafumi apologies for the noise raised by my comment. I'll stop entertaining this topic, since I think we already have at least a couple of solutions. 🙇 |
Beta Was this translation helpful? Give feedback.
-
+1 for JSON:API support |
Beta Was this translation helpful? Give feedback.
-
Hi everyone in this thread, I found it pretty hard to implement this feature. |
Beta Was this translation helpful? Give feedback.
-
The library looks flexible enough so adding support in my app for json:api with this gem should be trivial, was wondering if there is a deeper reason on why not supporting it, or is simply that you want to keep this gem nice and clean?
Beta Was this translation helpful? Give feedback.
All reactions