loopback-component-jsonapi icon indicating copy to clipboard operation
loopback-component-jsonapi copied to clipboard

Change all tests to use JSON API Content-Type

Open digitalsadhu opened this issue 10 years ago • 2 comments

Now that I think supertest/superagent has added support for application/vnd.api+json, (see https://github.com/visionmedia/superagent/issues/753) we should be able to modify all our tests to use Content-Type: application/vnd.api+json instead of application/json

This would be ideal if at a later stage we want to try to support switching how loopback handles input using the Content-Type header.

digitalsadhu avatar Oct 15 '15 17:10 digitalsadhu

Note: need to verify that superagent/supertest now supports Content-Type: application/vnd.api+json

digitalsadhu avatar Oct 16 '15 07:10 digitalsadhu

Pretty sure we still can't do this. I've added a helper that can be used instead of supertest based on the native http module for posts.

digitalsadhu avatar Oct 25 '15 19:10 digitalsadhu