File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
modules/openapi-generator/src/main/java/org/openapitools/codegen/utils Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -808,7 +808,13 @@ public static boolean isModelWithPropertiesOnly(Schema schema) {
808
808
(null != schema .getProperties () && !schema .getProperties ().isEmpty ()) &&
809
809
// no additionalProperties is set
810
810
(schema .getAdditionalProperties () == null ||
811
- (schema .getAdditionalProperties () instanceof Boolean && !(Boolean ) schema .getAdditionalProperties ()));
811
+ // additionalProperties is boolean and set to false
812
+ (schema .getAdditionalProperties () instanceof Boolean && !(Boolean ) schema .getAdditionalProperties ()) ||
813
+ // additionalProperties is a schema with its boolean value set to false
814
+ (schema .getAdditionalProperties () instanceof JsonSchema &&
815
+ ((JsonSchema ) schema .getAdditionalProperties ()).getBooleanSchemaValue () != null &&
816
+ !((JsonSchema ) schema .getAdditionalProperties ()).getBooleanSchemaValue ())
817
+ );
812
818
}
813
819
814
820
public static boolean hasValidation (Schema sc ) {
@@ -2415,7 +2421,7 @@ public static void copyMetadata(Schema from, Schema to) {
2415
2421
* For example, a schema that only has a `description` without any `properties` or `$ref` defined.
2416
2422
*
2417
2423
* @param schema the schema
2418
- * @return if the schema is only metadata and not an actual type
2424
+ * @return if the schema is only metadata and not an actual type
2419
2425
*/
2420
2426
public static boolean isMetadataOnlySchema (Schema schema ) {
2421
2427
return !(schema .get$ref () != null ||
You can’t perform that action at this time.
0 commit comments