Introduce new 'Prefer' header, params=single-object (#739)

This commit is contained in:
dsimunic
2016-11-20 14:14:39 -08:00
committed by Joe Nelson
parent 4df853eff9
commit ae40641963
8 changed files with 46 additions and 8 deletions
+5 -3
View File
@@ -182,12 +182,14 @@ makePostParams tn =
& schema .~ ParamBody (Ref (Reference tn))
]
makeProcParam :: Text -> Param
makeProcParam :: Text -> [Param]
makeProcParam refName =
(mempty :: Param)
[ makePreferParam ["params=single-object"]
, (mempty :: Param)
& name .~ "args"
& required ?~ True
& schema .~ ParamBody (Ref (Reference refName))
]
makeDeleteParams :: [Param]
makeDeleteParams =
@@ -224,7 +226,7 @@ makeProcPathItem :: ProcDescription -> (FilePath, PathItem)
makeProcPathItem pd = ("/rpc/" ++ toS (pdName pd), pe)
where
postOp = (mempty :: Operation)
& parameters .~ [Inline (makeProcParam $ "(rpc) " <> pdName pd)]
& parameters .~ map Inline (makeProcParam $ "(rpc) " <> pdName pd)
& tags .~ Set.fromList ["(rpc) " <> pdName pd]
& produces ?~ makeMimeList [CTApplicationJSON]
& at 200 ?~ "OK"