Skip to content
Pieter Verschaffelt edited this page Apr 21, 2019 · 8 revisions

The TypeScriptRestMapper package provides an easy-to-use and efficient way to automatically construct a service, which is capabel of performing REST CRUD-operations. No need to manually perform HTTP-requests, receive results, perform error handling and parse JSON into true TypeScript-objects. You only need to instanciate a new Service, with the correct type of object and you can start consuming REST API's immediatly.

This is the main wiki-page for this project. If you want to start quickly and see some real-life examples, you can follow our Quickstart guide. If you want a more in-depth and thorough explanation of the different concepts present in this package, you can read following pages in the order given here:

  1. Entity
  2. Decorators
  3. Service

FAQ:

Q: I'm getting a console warning telling me that some property was not found on the results. What does this mean?

A: This warning is automatically generated when you've annotated a field with a Read() decorator, that's not found in the REST response. The warning can help you track down bugs.

Q: Why do I need to explicitly pass the type of an Entity when creating a Service or annotating arrays?

A: One of the limitations posed by TypeScript is that we cannot access the generic type parameter during runtime, requiring you to explicitly pass this to a Service. TypeScript also does not expose the concrete type of an array at runtime, causing ReadArray(), StoreArray() and UpdateArray() to request it.

Clone this wiki locally