jsonapi-rb / jsonapi-renderer

Efficiently render JSON API documents.
http://jsonapi-rb.org
MIT License
27 stars 11 forks source link

Better to support comma-space-separator in IncludeDirective #18

Closed zhouqing86 closed 7 years ago

zhouqing86 commented 7 years ago

It would be great if JSONAPI::IncludeDirective support comma-space-separator String.

JSONAPI::IncludeDirective.new("friends, comments, posts")

Developers usually add space after comma.

beauby commented 7 years ago

@zhouqing86 Thanks for opening this issue. As I said in #16, I am against this. However, for developer-specified include lists, you can use the following syntax:

JSONAPI::IncludeDirective.new([:friends, :comments, :posts])
zhouqing86 commented 7 years ago

Thanks @beauby for your quick response!

I originally submit an issue on active_model_serializers which are using jsonapi-renderer. rails-api/active_model_serializers#2139

I am agree with your concern that we need to follow JSON API spec. Thanks again.

I will close this ticket!