OpenAPI: add required section for the non-nullable columns (#1148)
This commit is contained in:
committed by
Steve Chávez
parent
fa1e92fdf2
commit
2b46afe1ec
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user