You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ondrej Zizka edited this page Feb 27, 2017
·
1 revision
Rest end point in Web Support Addon
Process
Create an interface in web-support/api
This should extend the FurnaceRESTGraphAPI
NOTE: This interface provides several pieces of data to each REST endpoint implementation
1b. (optional) Create an required DTOs in the web-support/api module as well. NOTE: It is generally a good idea to annotate the class with @JsonIgnoreProperties({"handler", "delegate"}) in order to prevent jackson from inadvertently serializing proxy related fields.
Create an implementation of this interface in web-support/impl
This should extend AbstractGraphResource as that provides a base set of functionality
Add a reference to your new service to RestApplicationFurnace in the services war
Add a reference to it to the "getSingletons()" method
That's it! Your service should now be available to Windup at /services/rest-furnace/
Known Limitations
There is one limitation for return types of Rest End point method:
It requires to be known to windup-web-services, so use only Java Types like java.lang.Object, Collections in the API interface. Do not expose Windup Types otherwise it could end up with java.lang.TypeNotPresentException even a Type is dependency in provided scope.
DTO types in web-support/api need to be annotated with @JsonIgnoreProperties({"handler", "delegate"}), otherwise Jackson will serialize proxy related fields. Serializing proxy related fields can result in either duplicated data or crashes due to cycles in the data.