From 68720cef4ded799331829dcee4fe87dde77788d6 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Fri, 13 Oct 2017 23:16:58 -0500 Subject: [PATCH] Confirmed difference from jsonapi vs AMS not significant pretty clear now that the ONLY difference rendering a `user` with `include: 'posts.comments'` is that the included post's user relationship in jsonapirb is `meta: { included: false }` and AMS is `data: { id: 1, type: users}` which I guess is to avoid the user's post's comment from looking up the user? similarly, the included comment's post relationship for jsonapi-rb is `meta: { included: false}` and AMS is `data: { id: 2, type: posts }` took a bit of jq and diff to figure this out --- benchmarks/serialization_libraries/compare.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/benchmarks/serialization_libraries/compare.sh b/benchmarks/serialization_libraries/compare.sh index ca6228f3..a2f61c7f 100644 --- a/benchmarks/serialization_libraries/compare.sh +++ b/benchmarks/serialization_libraries/compare.sh @@ -30,9 +30,13 @@ compare_files() { } echo -echo "data" +echo "-------------------------------------data" compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".data" -echo "included" -# compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included | .[] | select(.type == \"posts\")" -# compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included | .[] | select(.type == \"comments\")" -compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included | .[] | select(.type != \"comments\", .type != \"posts\")" +echo "-------------------------------------included posts" +compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included | .[] | select(.type == \"posts\")" +echo "-------------------------------------included comments" +compare_files support/json_document-ams.json support/json_document-jsonapi_rb.json ".included | .[] | select(.type == \"comments\")" +echo "-------------------------------------included types: ams" +jq '.included | .[] | .type' -S < support/json_document-ams.json | sort -u +echo "-------------------------------------included types: jsonapi_rb" +jq '.included | .[] | .type' -S < support/json_document-jsonapi_rb.json | sort -u