Skip to content

[BUG][Java] Remove java warning during compilation #10788

@vgalloy

Description

@vgalloy

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Generated Java class named "ApiClient" produce a warning during compilation

openapi-generator version

Version 5.3.0
Generator: Java
Library: resttemplate
Gradle: 7.2
Java version: 16

Generation Details

build.gradle.kts

plugins {
  id("java")
  id("org.openapi.generator") version ("5.3.0")
}

openApiGenerate {
  generatorName.set("java")
  library.set("resttemplate")
  inputSec.set(....)
}
./gradlew myProject:build
  ...:compileJava
  ApiClient.java uses unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
Related issues/PRs

I will propose with the sugested fix

#10789

Suggest a fix

Add @SuppressWarnings("unchecked")

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions