Closed Discountrobot closed 8 years ago
Added a tslint.json config file so that contributions can be uniform in style.
Fixed a bug i introduces..
Added support for the HEAD method ( writing a swagger.io spec client generator, so i need to support these)
Adapted the JAX-RS notation, for specifying what response MIME type to expect, and then return the parsed result to the responseIntercepter.
import {... Produces, MediaType} from 'angular2-rest'; export class TodoRESTClient extends RESTClient { protected requestInterceptor(req: Request) { // } protected responseInterceptor(obs: Observable) { return obs.debounceTime(1000); } @GET("todo/") @Produces(MediaType.JSON) public getTodos( @Query("sort") sort?: string): Observable { return null; }; // => returns JSON.parsed object @GET("todo/{id}") public getTodoById( @Path("id") id: string): Observable { return null; }; // => returns a string }
One could also argue that responses should be parsed by default, should 'Accept': 'application/json' be set, as the server should always respond with a parseable JSON string?
'Accept': 'application/json'
Thanks @Discountrobot, awesome stuff!
chore(tslint) better collaboration effort
Added a tslint.json config file so that contributions can be uniform in style.
fix(pPath url scoped)
Fixed a bug i introduces..
feat(methodBuilder) added HEAD method
Added support for the HEAD method ( writing a swagger.io spec client generator, so i need to support these)
feat(@Produces) short-hand decorator for parsing responses
Adapted the JAX-RS notation, for specifying what response MIME type to expect, and then return the parsed result to the responseIntercepter.
One could also argue that responses should be parsed by default, should
'Accept': 'application/json'
be set, as the server should always respond with a parseable JSON string?