Skip to content

Commit 6177089

Browse files
authored
Merge pull request #139 from SentryMan/valid
Fix annotations on openapi schema
2 parents b9b1eaf + 3fd124b commit 6177089

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

http-generator-core/src/main/java/io/avaje/http/generator/core/Util.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static String typeDef(TypeMirror typeMirror) {
3838
}
3939
}
4040

41-
static String trimAnnotations(String type) {
41+
public static String trimAnnotations(String type) {
4242
int pos = type.indexOf("@");
4343
if (pos == -1) {
4444
return type;

http-generator-core/src/main/java/io/avaje/http/generator/core/openapi/SchemaDocBuilder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.avaje.http.generator.core.openapi;
22

3+
import io.avaje.http.generator.core.Util;
34
import io.swagger.v3.oas.annotations.Hidden;
45
import io.swagger.v3.oas.models.Operation;
56
import io.swagger.v3.oas.models.media.ArraySchema;
@@ -203,8 +204,9 @@ private Schema<?> buildMapSchema(TypeMirror type) {
203204
}
204205

205206
private String getObjectSchemaName(TypeMirror type) {
206-
String canonicalName = type.toString();
207-
int pos = canonicalName.lastIndexOf('.');
207+
208+
var canonicalName = Util.trimAnnotations(type.toString());
209+
final var pos = canonicalName.lastIndexOf('.');
208210
if (pos > -1) {
209211
canonicalName = canonicalName.substring(pos + 1);
210212
}

0 commit comments

Comments
 (0)