-
Notifications
You must be signed in to change notification settings - Fork 28
Dev: Creating new REST endpoints for access Windup graph data
- 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
-
Inject the service. For example:
@Inject @FromFurnace private DependenciesReportResource dependenciesReportResource;
-
Add a reference to it to the "getSingletons()" method
-
-
That's it! Your service should now be available to Windup at /services/rest-furnace/
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 withjava.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.