a2-in-memory-web-api icon indicating copy to clipboard operation
a2-in-memory-web-api copied to clipboard

Why is the response wrapped in a data object?

Open frederikschubert opened this issue 8 years ago • 4 comments

The wrapping of the GET response in a data object forces the user of this lib to perform the same wrapping in his/her backend. This is sometimes not possible. Would it be possible to deliver the pure response data for a GET request?

frederikschubert avatar May 18 '16 04:05 frederikschubert

Probably could use some flexibility here. An extension point of some kind. Suggest something ... in a PR preferably

wardbell avatar May 18 '16 20:05 wardbell

I am traveling right now so i cannot contribute with a PR. But wouldn't it be sufficient to change this? I mean just passing back the copy of whatever the user of the lib provided for that resource.

frederikschubert avatar May 18 '16 20:05 frederikschubert

Please see the discussion of JSON security and best practices in the http chapter. We will keep this default. I am.open to an extension point that let's you return anything you want.

Or fork it and go your own way. This repo exists to support the documentation. It is not intended for real world app development although if it satisfies, that's great.

wardbell avatar May 18 '16 20:05 wardbell

Ok, thanks for your quick response. I will think about how an extension point might look like and contribute a PR as soon as I am back home.

frederikschubert avatar May 18 '16 20:05 frederikschubert