fix: empty enum in 'preferParams' openAPI parameter

This commit is contained in:
Laurence Isla
2025-08-29 22:57:56 +00:00
parent 7a2840fba6
commit 043b1f97ee
3 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -171,8 +171,9 @@ makePreferParam ts =
& schema .~ ParamOther ((mempty :: ParamOtherSchema)
& in_ .~ ParamHeader
& type_ ?~ SwaggerString
& enum_ .~ JSON.decode (JSON.encode $ foldl (<>) [] (val <$> ts)))
& enum_ .~ if null enu then Nothing else JSON.decode (JSON.encode enu))
where
enu = foldl (<>) [] (val <$> ts)
val :: Text -> [Text]
val = \case
"count" -> ["count=none"]