diff --git a/springwolf-asyncapi/src/main/java/io/github/stavshamir/springwolf/asyncapi/v3/model/channel/message/MessageReference.java b/springwolf-asyncapi/src/main/java/io/github/stavshamir/springwolf/asyncapi/v3/model/channel/message/MessageReference.java index a182b071b..3141f3327 100644 --- a/springwolf-asyncapi/src/main/java/io/github/stavshamir/springwolf/asyncapi/v3/model/channel/message/MessageReference.java +++ b/springwolf-asyncapi/src/main/java/io/github/stavshamir/springwolf/asyncapi/v3/model/channel/message/MessageReference.java @@ -50,6 +50,9 @@ public static MessageReference toSchema(String schemaName) { } public static String extractRefName(String ref) { - return ref.substring(ref.lastIndexOf('/') + 1); + if(ref.contains("/")) { + return ref.substring(ref.lastIndexOf('/') + 1); + } + return ref; } }