@@ -114,7 +114,8 @@ public void enhanceRequestBodyContent(OpenAPI openAPI, ResourceMetadata resource
114114 Schema newSchema = new ObjectSchema ();
115115 newSchema .setRequired (existingSchema .getRequired ());
116116 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 ));
118119 schemas .put (newKey , newSchema );
119120 schema .set$ref (Components .COMPONENTS_SCHEMAS_REF + newKey );
120121 }
@@ -208,7 +209,7 @@ private void updateRequestBodySchema(List<String> associationsFields, Schema new
208209 * @param propId the prop id
209210 * @param val the val
210211 */
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 ) {
212213 if (EMBEDDED .equals (propId )) {
213214 String entityClassName = linkRelationProvider .getCollectionResourceRelFor (returnType ).value ();
214215 ArraySchema arraySchema = (ArraySchema ) ((ObjectSchema ) val ).getProperties ().get (entityClassName );
0 commit comments