Update OpenAPI (SQL COMMENT to description, constraints, cleaning up) (#885)

This commit is contained in:
Lucas Desgouilles
2017-07-22 10:56:23 -05:00
committed by Joe Nelson
parent 7fcdbf9153
commit 6d5f72bf5f
8 changed files with 288 additions and 221 deletions
+2 -2
View File
@@ -267,8 +267,8 @@ app dbStructure conf apiRequest =
uri Nothing = ("http", host, port, "/")
uri (Just Proxy { proxyScheme = s, proxyHost = h, proxyPort = p, proxyPath = b }) = (s, h, p, b)
uri' = uri proxy
encodeApi ti = encodeOpenAPI (M.elems allProcs) ti uri'
body <- encodeApi . toTableInfo <$> H.query schema accessibleTables
encodeApi ti sd = encodeOpenAPI (M.elems allProcs) (toTableInfo ti) uri' sd (dbPrimaryKeys dbStructure)
body <- encodeApi <$> H.query schema accessibleTables <*> H.query schema schemaDescription
return $ responseLBS status200 [toHeader CTOpenAPI] $ toS body
_ -> return notFound