-
Notifications
You must be signed in to change notification settings - Fork 108
Previous Versions
Thiago Bustamante edited this page Jan 20, 2019
·
7 revisions
The following breaking changes must be observed when updating typescript-rest to 2.X version.
Starting from version 1.0.0, it is required to inform the body type on all ReferencedResources, like:
interface NewObject {
id: string;
}
class TestService {
@POST
test(myObject: MyClass): Return.NewResource<NewObject> {
//...
return new Return.NewResource<NewObject>(req.url + "/" + generatedId, {id: generatedId}); //Returns a JSON on body {id: generatedId}
}
}
Even when you do not provide a body on a ReferencedResource, you need to inform <void>
class TestService {
@POST
test(myObject: MyClass): Return.RequestAccepted<void> {
//...
return new Return.RequestAccepted<void>(req.url + "/" + generatedId);
}
}
-
Starting from version 2.0.0, the method
Server.setParamConverter
was removed and replaced byServer.addParameterConverter
. -
The method
Server.swagger
was refactored to receive anSwaggerOptions
object. -
Deprecated
ForbidenError
was removed in favor ofForbiddenError
. -
The decorator
@Preprocessor
was renamed to@PreProcessor
.
- Server
- @Path Decorator
- Http Methods
- Request Parameters
- Types and languages
- @BodyOptions Decorator
- Service Context
- Service Return
- @Security Decorator
- Express Middlewares
- @PreProcessor Decorator
- @PostProcessor Decorator
- Server Errors
- Service Factory and IoC
- Inheritance and Abstract Services
- Swagger Documentation