@@ -585,4 +585,35 @@ public void isUnsupportedSchemaTest() {
585
585
assertFalse (ModelUtils .isUnsupportedSchema (openAPI , (Schema ) property2 .getProperties ().get ("condition" )));
586
586
assertFalse (ModelUtils .isUnsupportedSchema (openAPI , (Schema ) property2 .getProperties ().get ("purpose" )));
587
587
}
588
+
589
+ @ Test
590
+ public void testModelWithPropertiesOnly () {
591
+ // Schema with no properties
592
+ Schema testSchema = new ObjectSchema ().properties (null );
593
+ assertFalse (ModelUtils .isModelWithPropertiesOnly (testSchema ));
594
+
595
+ // Schema with properties
596
+ testSchema .setProperties (Map .of ("foo" , new Schema ()));
597
+ assertTrue (ModelUtils .isModelWithPropertiesOnly (testSchema ));
598
+
599
+ // Explicitly no additional properties
600
+ testSchema .setAdditionalProperties (false );
601
+ assertTrue (ModelUtils .isModelWithPropertiesOnly (testSchema ));
602
+
603
+ // With additional properties
604
+ testSchema .setAdditionalProperties (true );
605
+ assertFalse (ModelUtils .isModelWithPropertiesOnly (testSchema ));
606
+
607
+ // Additional properties is a schema set to false
608
+ testSchema .setAdditionalProperties (new Schema ().booleanSchemaValue (false ));
609
+ assertTrue (ModelUtils .isModelWithPropertiesOnly (testSchema ));
610
+
611
+ // Additional properties is a schema set to true
612
+ testSchema .setAdditionalProperties (new Schema ().booleanSchemaValue (true ));
613
+ assertFalse (ModelUtils .isModelWithPropertiesOnly (testSchema ));
614
+
615
+ // Additional properties is a custom schema
616
+ testSchema .setAdditionalProperties (new Schema ().type ("string" ));
617
+ assertFalse (ModelUtils .isModelWithPropertiesOnly (testSchema ));
618
+ }
588
619
}
0 commit comments