Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenAPI Tools
openapi-generator
Commits
784d19fe
Commit
784d19fe
authored
2 years ago
by
Thomas Kalmár
Browse files
Options
Download
Email Patches
Plain Diff
Support deep linking of refs
parent
d8bed422
github/fork/tkalmar/master
1 merge request
!13980
Support deep linking of refs
Pipeline
#716
failed with stages
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java
+7
-2
.../main/java/org/openapitools/codegen/utils/ModelUtils.java
with
7 additions
and
2 deletions
+7
-2
modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java
+
7
-
2
View file @
784d19fe
...
...
@@ -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);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets