21
21
* * * *
22
22
* * *
23
23
* *
24
- *
24
+ *
25
25
*/
26
26
27
27
package org .springdoc .core .utils ;
@@ -128,6 +128,7 @@ public static Schema resolveSchemaFromType(Class<?> schemaImplementation, Compon
128
128
* @return the schema
129
129
*/
130
130
public static Schema extractSchema (Components components , Type returnType , JsonView jsonView , Annotation [] annotations , SpecVersion specVersion ) {
131
+ if (returnType == null ) return null ;
131
132
Schema schemaN = null ;
132
133
ResolvedSchema resolvedSchema ;
133
134
boolean openapi31 = SpecVersion .V31 == specVersion ;
@@ -161,9 +162,9 @@ public static Schema extractSchema(Components components, Type returnType, JsonV
161
162
else if (componentSchemas .containsKey (entry .getKey ()) && schemaMap .containsKey (entry .getKey ())) {
162
163
// Check to merge polymorphic types
163
164
Set <Schema > existingAllOf = new LinkedHashSet <>();
164
- if (existingSchema .getAllOf () != null )
165
+ if (existingSchema .getAllOf () != null )
165
166
existingAllOf .addAll (existingSchema .getAllOf ());
166
- if (schemaMap .get (entry .getKey ()).getAllOf () != null ){
167
+ if (schemaMap .get (entry .getKey ()).getAllOf () != null ) {
167
168
existingAllOf .addAll (schemaMap .get (entry .getKey ()).getAllOf ());
168
169
existingSchema .setAllOf (new ArrayList <>(existingAllOf ));
169
170
}
@@ -179,9 +180,9 @@ else if (componentSchemas.containsKey(entry.getKey()) && schemaMap.containsKey(e
179
180
schemaN = resolvedSchema .schema ;
180
181
}
181
182
}
182
- if (openapi31 )
183
+ if (openapi31 )
183
184
handleSchemaTypes (schemaN );
184
-
185
+
185
186
return schemaN ;
186
187
}
187
188
0 commit comments