@@ -114,7 +114,8 @@ public void enhanceRequestBodyContent(OpenAPI openAPI, ResourceMetadata resource
114
114
Schema newSchema = new ObjectSchema ();
115
115
newSchema .setRequired (existingSchema .getRequired ());
116
116
Map <String , Schema > properties = existingSchema .getProperties ();
117
- properties .forEach ((propId , val ) -> updateRequestBodySchema (associationsFields , newSchema , propId , val ));
117
+ if (!CollectionUtils .isEmpty (properties ))
118
+ properties .forEach ((propId , val ) -> updateRequestBodySchema (associationsFields , newSchema , propId , val ));
118
119
schemas .put (newKey , newSchema );
119
120
schema .set$ref (Components .COMPONENTS_SCHEMAS_REF + newKey );
120
121
}
@@ -208,7 +209,7 @@ private void updateRequestBodySchema(List<String> associationsFields, Schema new
208
209
* @param propId the prop id
209
210
* @param val the val
210
211
*/
211
- private void updateResponseSchema (Schema newSchema , Class <?> returnType , List <String > ignoredFields , String propId , Schema val ) {
212
+ private void updateResponseSchema (Schema newSchema , Class <?> returnType , List <String > ignoredFields , String propId , Schema val ) {
212
213
if (EMBEDDED .equals (propId )) {
213
214
String entityClassName = linkRelationProvider .getCollectionResourceRelFor (returnType ).value ();
214
215
ArraySchema arraySchema = (ArraySchema ) ((ObjectSchema ) val ).getProperties ().get (entityClassName );
0 commit comments