Inspectopedia Help

Incorrect parameter type of resource method

Reports resource method parameters (annotated with @PathParam, @QueryParam, and so on) with unsupported types.

The type of the annotated parameter, field, or property must meet one of the following requirements:

  1. Be a primitive type

  2. Have a constructor that accepts a single String argument

  3. Have a static method named valueOf() or fromString() that accepts a single String argument, for example, Integer.valueOf(String).

  4. Have a registered implementation of ParamConverterProvider JAX-RS extension SPI that returns a ParamConverter instance capable of converting a string to a particular type.

  5. Be List<T>, Set<T>, or SortedSet<T>, where T satisfies 2, 3, or 4 above. The resulting collection is read-only.

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

RestParamTypeInspection
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | RESTful Web Service (JAX-RS)

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.2, Qodana for JVM 2024.2,

Can be installed with plugin:

Jakarta EE: RESTful Web Services (JAX-RS), 242.22892

Last modified: 11 September 2024