OpenAPI: add required section for the non-nullable columns (#1148)

This commit is contained in:
Alexey Alekhin
2018-07-23 11:11:45 -05:00
committed by Steve Chávez
parent fa1e92fdf2
commit 2b46afe1ec
3 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -42,7 +42,8 @@ makeTableDef pks (t, cs, _) =
(tn, (mempty :: Schema)
& description .~ tableDescription t
& type_ .~ SwaggerObject
& properties .~ fromList (map (makeProperty pks) cs))
& properties .~ fromList (map (makeProperty pks) cs)
& required .~ map colName (filter (not . colNullable) cs))
makeProperty :: [PrimaryKey] -> Column -> (Text, Referenced Schema)
makeProperty pks c = (colName c, Inline s)