Commit 784d19fe authored by Thomas Kalmár's avatar Thomas Kalmár
Browse files

Support deep linking of refs

1 merge request!13980Support deep linking of refs
Pipeline #716 failed with stages
in 0 seconds
Showing with 7 additions and 2 deletions
+7 -2
......@@ -383,9 +383,14 @@ public class ModelUtils {
//throw new RuntimeException("Failed to get the schema: null");
return null;
} else if (ref.startsWith("#/components/")) {
ref = ref.substring(ref.lastIndexOf("/") + 1);
ref = ref.substring("#/components/".length()) ;
// allow deep-linking, only remove first ref in components (schemas, pathitems, ...)
if (ref.contains("/")) {
ref = ref.substring(ref.indexOf('/') + 1 );
}
} else if (ref.startsWith("#/definitions/")) {
ref = ref.substring(ref.lastIndexOf("/") + 1);
ref = ref.substring("#/definitions/".length());
} else {
once(LOGGER).warn("Failed to get the schema name: {}", ref);
//throw new RuntimeException("Failed to get the schema: " + ref);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment