Skip to content

Commit 9b9ed17

Browse files
lipiridifrantuma
authored andcommitted
fix: Replace $ in the FQN of the class
Fixes swagger semantic errors: 1. Component names can only contain the characters A-Z a-z 0-9 - . _ 2. $ref values must be RFC3986-compliant percent-encoded URIs
1 parent 119e5cc commit 9b9ed17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/TypeNameResolver.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected String nameForClass(Class<?> cls, Set<Options> options) {
6060
}
6161

6262
protected String getNameOfClass(Class<?> cls) {
63-
return useFqn?cls.getName():cls.getSimpleName();
63+
return useFqn ? cls.getName().replace("$", ".") : cls.getSimpleName();
6464
}
6565

6666
protected String nameForGenericType(JavaType type, Set<Options> options) {

0 commit comments

Comments
 (0)