From 190b7b7787a24096dca15c5b343e6e4d8b895c29 Mon Sep 17 00:00:00 2001 From: Timon Back Date: Fri, 9 Feb 2024 22:54:04 +0100 Subject: [PATCH] handle refs without prefix --- .../asyncapi/v3/model/channel/message/MessageReference.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } }