diff --git a/zio-http/shared/src/main/scala/zio/http/endpoint/openapi/JsonSchema.scala b/zio-http/shared/src/main/scala/zio/http/endpoint/openapi/JsonSchema.scala index 0d8c5dacbe..aa75b8682c 100644 --- a/zio-http/shared/src/main/scala/zio/http/endpoint/openapi/JsonSchema.scala +++ b/zio-http/shared/src/main/scala/zio/http/endpoint/openapi/JsonSchema.scala @@ -1215,6 +1215,8 @@ object JsonSchema { def addAll(value: Chunk[(java.lang.String, JsonSchema)]): Object = value.foldLeft(this) { case (obj, (name, schema)) => schema match { + case Object(properties, additionalProperties, _) if properties.isEmpty && additionalProperties.isRight => + obj.copy(properties = obj.properties + (name -> schema)) case Object(properties, additionalProperties, required) => obj.copy( properties = obj.properties ++ properties,