vt-elixir / ja_serializer

JSONAPI.org Serialization in Elixir.
Other
640 stars 148 forks source link

Assertions for JSON API tests #347

Closed ravecat closed 3 months ago

ravecat commented 3 months ago

How can you test API responses that conform to the JSON API specification? Do you have any assertions for tests?

beerlington commented 3 months ago

JaSerializer does not have any built-in assertions for tests, but it's pretty easy to write your own. You can trust that the library is doing the formatting correctly, and can write helpers to extract values from the "attributes" key or test that various relationships are included.