You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yamireh
changed the title
Incorrect Import Statement for Resource Class in Generated Code with Swagger Codegen v3.0.47 and above
Incorrect Import Statement for Resource Class in Generated Code with Swagger Codegen v3.0.46
Jan 12, 2025
Description
I have a swagger that has "Resource" on of it's swagger models.
When generating code using Swagger Codegen v3.0.46 and above, the generated ApiApi class includes the following incorrect import statement:
import org.springframework.core.io.Resource;
However, the application requires the import to point to a custom class which is part of my swagger:
import com.org.web.dto.Resource;
This issue occurs specifically for the Resource class, which conflicts with org.springframework.core.io.Resource due to naming overlap.
Swagger-codegen version
v3.0.46
Swagger declaration file content or url
Command line used for generation
JDK21
spring boot 3.4.1
io.swagger.codegen.v3
swagger-codegen-maven-plugin
3.0.46
Steps to reproduce
generate the swagger model classes and it won't compile due to importing the wrong Resource class.
Related issues/PRs
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: