Junos Space SDK > Developer Guides > Junos Space Application Developer Guide > Programming with the Junos Space SDK > Using the Junos Space SDK Plug-in > Using the EJB-REST Wizard

RESTifying Interfaces Manually

This topic explains the procedure for RESTifying interfaces manually. When you use the EJB-REST wizard to RESTify code, the new code generated by the wizard will overwrite/replace any existing REST interfaces. Use this procedure to add custom code to a REST resource using the EJB-REST wizard.

Note: Do not manually modify the automatically generated functions such as HATEAOS and info service.

Every time you make changes with the wizard, the wizard reflects these changes in both the REST interface and the REST implementation files. Any additional "manual" changes you have made to the code are shown in the left pane of the compare window. You can copy these changes to the right pane.

Note: To retain any manual changes, you must copy these changes from the left pane to the right pane every time you use the wizard to modify code in that method. If you do not change a method that you have manually changed, those manual changes are preserved in the method even if other methods have been changed.

You can edit any existing interface or configure a REST resource using the EJB-REST wizard. For more information, see the Managing REST Resources topic.

  1. After configuring a REST resource using the EJB-REST wizard, click Finish. The Conflict issues in the REST Resources window is displayed.
  2. Click Finish. The Difference Viewer to appears.
  3. The list in the top of the dialog displays all changed files. Clicking on a file opens a difference viewer for that file.

    The REST Resource Compare screen displays the old REST code in the left panel and the newly generated REST code in the right panel.

  4. You can make changes to the new code in the right panel as needed, using the top buttons to navigate to code differences and changes, and to copy code changes from the old source code to the new code in the right pane. When finished, use the appropriate option:

The interface is RESTified and the code changes are reflected in the generated REST code accordingly.