Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classes / enums with same name but different package replace each other #4789

Open
T3rm1 opened this issue Nov 18, 2024 · 1 comment
Open

Comments

@T3rm1
Copy link

T3rm1 commented Nov 18, 2024

If your project has two or more classes (also enums) with the same name (but different packages) they replace each other during model definition.

public class MyClass {
    private ClassWithSameName classOne;
    private subpackge.ClassWithSameName classTwo;

    // getters and setters
}

There will only be one generated Schema for ClassWithSameName and both properties point to the same definition. Same problem for enums when they are resolved as refs.
I'm aware of useFqn in TypeNameResolver but this setting affects all names. I'd prefer a solution where the name is only changed in case of a collision.

@T3rm1
Copy link
Author

T3rm1 commented Jan 17, 2025

Bump @frantuma

This is critical and very annoying to work around if you have no control over the classes that share the same name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant