This feature is supported in the Ultimate edition only.
Besides the common Web services support, IntelliJ IDEA provides the following facilities for developing RESTful Web services:
- Code completion for MIME type.
- Code inspections and quick fixes.
- REST Client tool window for testing RESTful Web services.
Code inspection and quick fixes
IntelliJ IDEA supports code inspections and suggests quick fixes in the following cases:
| Issue | Default Quick Fix |
|---|---|
Inconsistency between a method annotation and the method return type:
a @GET annotated method returns void value. | Change to String. |
| Resource methods errors. | Remove @Path annotation. |
| Incorrect parameter type. |
Validation for parameters annotated with @QueryParam or @PathParam annotations.
|
@DefaultValue issues.
|
@GET public String get(@DefaultValue("33.5") @QueryParam("str") int str){ return "Hello"; } DefaultValue is marked red with the description "Can't convert to int".
|
Rest @Path and @PathParam annotations inspections.
| |
| Rest References resolve problems. |
References in @PathParam annotations are resolved to templates in @Path annotations
|
| This method should have only one HTTP method designator. |
Example:
@GET @POST public String get(){ return "Hello"; } @POST is marked red.
|
| WADL configuration errors. | |
Rest client tool window
Dedicated REST Client tool window supports:
- Constituting URL addresses semiautomatically from the specified Deployment point and the
@Pathannotation. - Submitting requests to the server.
- Displaying server responses in the Response tab.
- Code integration between the Java code and the contents of the REST Client window controls.
| Change in the Java code | Change in the REST Client tool window |
|---|---|
@Path annotation is updated. | The contents of the Path to resource drop-down list change. |
@Produces annotation is updated. | The contents of the Accept drop-down list change. |