Skip to content

Commit 261db8e

Browse files
committed
Clarify orphaned coverage
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
1 parent 1dd7bc5 commit 261db8e

File tree

1 file changed

+2
-2
lines changed
  • modules/openapi-generator/src/main/java/org/openapitools/codegen/utils

1 file changed

+2
-2
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ public static List<Schema> getAllSchemasInDocument(OpenAPI openAPI) {
11131113
}
11141114
});
11151115

1116-
// Also visit component schemas not reachable from any path (orphaned schemas)
1116+
// Also visit components/schemas entries not reachable from any path
11171117
List<String> refSchemas = new ArrayList<String>();
11181118
getSchemas(openAPI).forEach((key, schema) -> {
11191119
visitSchema(openAPI, schema, null, refSchemas, (s, mimeType) -> {
@@ -1164,7 +1164,7 @@ public static RequestBody getRequestBody(OpenAPI openAPI, String name) {
11641164
*/
11651165
public static ApiResponse getReferencedApiResponse(OpenAPI openAPI, ApiResponse apiResponse) {
11661166
if (apiResponse != null && StringUtils.isNotEmpty(apiResponse.get$ref())) {
1167-
String name = getSimpleRef(apiResponse.get$ref());
1167+
String name = getSimpleRef(apiResponse.get$ref(schemas));
11681168
ApiResponse referencedApiResponse = getApiResponse(openAPI, name);
11691169
if (referencedApiResponse != null) {
11701170
return referencedApiResponse;

0 commit comments

Comments
 (0)