[BUG][JAVA] Add @Nullable to resttemplate api method parameters
PR checklist
- Read the contribution guidelines.
- Pull Request title clearly describes the work in the checklist and does not contain an issue number.
- Ran the generator tests (
JavaClientCodegenTest).
Description
When useJspecify=true, package-info files are marked with @NullMarked. For the resttemplate library, API operation methods previously emitted raw parameter types without @Nullable, causing static analysis tools to flag optional parameters as non-null.
This change updates resttemplate/api.mustache to use {{>nullableArgumentForApi}}, matching webclient and restclient. It also enables the corresponding assertions in JavaClientCodegenTest and updates the sample output.
Fixes #23656.
Summary by cubic
Adds @Nonnull and @Nullable annotations to resttemplate API method parameters so required and optional parameters are explicit to static analysis tools. Previously generated methods had no nullability annotations, which made optional parameters look non-null under JSpecify @NullMarked packages. api.mustache now uses the same nullable argument partial as webclient and restclient. Fixes #23656.
- Enables the existing JSpecify parameter assertions in
JavaClientCodegenTestforresttemplate. - Regenerates the resttemplate samples, including the
resttemplate-springBoot4-jackson3-jspecifysample.