Skip to content

Commit 9043140

Browse files
committed
Exception logged when generating schema for delete method of Spring Data repository. Fixes #2869
1 parent ee1bfa2 commit 9043140

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* * * *
2222
* * *
2323
* *
24-
*
24+
*
2525
*/
2626

2727
package org.springdoc.core.utils;
@@ -128,6 +128,7 @@ public static Schema resolveSchemaFromType(Class<?> schemaImplementation, Compon
128128
* @return the schema
129129
*/
130130
public static Schema extractSchema(Components components, Type returnType, JsonView jsonView, Annotation[] annotations, SpecVersion specVersion) {
131+
if (returnType == null) return null;
131132
Schema schemaN = null;
132133
ResolvedSchema resolvedSchema;
133134
boolean openapi31 = SpecVersion.V31 == specVersion;
@@ -161,9 +162,9 @@ public static Schema extractSchema(Components components, Type returnType, JsonV
161162
else if (componentSchemas.containsKey(entry.getKey()) && schemaMap.containsKey(entry.getKey())) {
162163
// Check to merge polymorphic types
163164
Set<Schema> existingAllOf = new LinkedHashSet<>();
164-
if(existingSchema.getAllOf() != null)
165+
if (existingSchema.getAllOf() != null)
165166
existingAllOf.addAll(existingSchema.getAllOf());
166-
if (schemaMap.get(entry.getKey()).getAllOf() != null){
167+
if (schemaMap.get(entry.getKey()).getAllOf() != null) {
167168
existingAllOf.addAll(schemaMap.get(entry.getKey()).getAllOf());
168169
existingSchema.setAllOf(new ArrayList<>(existingAllOf));
169170
}
@@ -179,9 +180,9 @@ else if (componentSchemas.containsKey(entry.getKey()) && schemaMap.containsKey(e
179180
schemaN = resolvedSchema.schema;
180181
}
181182
}
182-
if(openapi31)
183+
if (openapi31)
183184
handleSchemaTypes(schemaN);
184-
185+
185186
return schemaN;
186187
}
187188

0 commit comments

Comments
 (0)