Fix the invalid order parameter bug found by test

This commit is contained in:
Jacky Hu
2016-06-18 10:18:43 +08:00
parent 0220040341
commit a9ffde4d5f
+13 -4
View File
@@ -127,16 +127,25 @@ makePreferParam ts =
& type_ .~ SwaggerString & type_ .~ SwaggerString
& enum_ .~ decode (encode ts)) & enum_ .~ decode (encode ts))
makeGetParams :: [Column] -> [Param] makeSelectParam :: Param
makeGetParams cs = makeSelectParam =
makeRangeParams ++ (mempty :: Param)
[ (mempty :: Param)
& name .~ "select" & name .~ "select"
& description ?~ "Filtering Columns" & description ?~ "Filtering Columns"
& required ?~ False & required ?~ False
& schema .~ ParamOther ((mempty :: ParamOtherSchema) & schema .~ ParamOther ((mempty :: ParamOtherSchema)
& in_ .~ ParamQuery & in_ .~ ParamQuery
& type_ .~ SwaggerString) & type_ .~ SwaggerString)
makeGetParams :: [Column] -> [Param]
makeGetParams [] =
makeRangeParams ++
[ makeSelectParam
, makePreferParam ["plurality=singular", "count=none"]
]
makeGetParams cs =
makeRangeParams ++
[ makeSelectParam
, (mempty :: Param) , (mempty :: Param)
& name .~ "order" & name .~ "order"
& description ?~ "Ordering" & description ?~ "Ordering"