@@ -906,7 +906,10 @@ instance ToJSON SecurityScheme where
906 toJSON = genericToJSONWithSub "type" (jsonPrefix "securityScheme")
906 toJSON = genericToJSONWithSub "type" (jsonPrefix "securityScheme")
908instance ToJSON Schema where
908instance ToJSON Schema where
909− toJSON = omitEmpties . genericToJSONWithSub "paramSchema" (jsonPrefix "schema")
909+ toJSON = omitEmptiesExcept f . genericToJSONWithSub "paramSchema" (jsonPrefix "schema")
911+ f "items" (Array _) = True
911instance ToJSON Header where
914instance ToJSON Header where
912 toJSON = genericToJSONWithSub "paramSchema" (jsonPrefix "header")
915 toJSON = genericToJSONWithSub "paramSchema" (jsonPrefix "header")
@@ -985,7 +988,10 @@ instance ToJSON (CollectionFormat t) where
985 toJSON CollectionMulti = "multi"
988 toJSON CollectionMulti = "multi"
987instance ToJSON (ParamSchema t) where
990instance ToJSON (ParamSchema t) where
988− toJSON = omitEmpties . genericToJSONWithSub "items" (jsonPrefix "paramSchema")
991+ toJSON = omitEmptiesExcept f . genericToJSONWithSub "items" (jsonPrefix "paramSchema")
993+ f "items" (Array _) = True
990-- =======================================================================
996-- =======================================================================
991-- Manual FromJSON instances
997-- Manual FromJSON instances