Closed
Description
If you attempt to serialize an empty array with the JSON adapter and ArraySerializer, the root key becomes an empty string. This issue is present in 0.10.0.rc2 and the latest master branch commit at this time (17c353826056bc3eac3e6d6a2fd081af175bb6ad
).
Example Code
class Api::V1::ArticlesController < Api::V1::BaseController
def index
@articles = []
render json: @articles, each_serializer: Api::V1::ArticleSerializer
end
end
Expected
{
"articles": []
}
Actual
{
"": []
}