TryGhost / SDK

Tools for working with Ghost's APIs
MIT License
116 stars 76 forks source link

Add an option to skip response formatting in Content/Admin API SDKs #73

Open kevinansfield opened 5 years ago

kevinansfield commented 5 years ago

Currently the content/admin api SDKs format the response that is received from the API.

We'd like to add a "format response" boolean option to the SDKs so that consumers have the option to skip formatting and receive the raw data that is returned from the API.

Our initial use-case for this is a tool that can automatically generate request/response documentation for our API.

Robogeek95 commented 4 years ago

@kevinansfield So the the fix should allow something like:

const api = new GhostContentAPI({
  url: 'YOUR URL',
  key: 'YOUR KEY',
  version: "VERSION",
  formatResponse: true/false
})

so the option formatted option can be passed along with these options and should default to true

phawazzzy commented 4 years ago

@Robogeek95.. i agree with you on this...then we can just check the for config.formatResponse to know how the response will come ..weather formatted or not formatted

nextwebb commented 4 years ago

@kevinansfield @ErisDS where would be the right place to dig for a possible fix?