Introduce the OpenAPI header
Also bring back the original behavior of GET "/"
This commit is contained in:
@@ -204,7 +204,9 @@ app dbStructure conf apiRequest =
|
||||
else return notFound
|
||||
|
||||
(ActionRead, TargetRoot, Nothing) -> do
|
||||
body <- (encodeApi . toTableInfo) <$> H.query schema accessibleTables
|
||||
body <- if contentType == OpenAPI
|
||||
then (encodeApi . toTableInfo) <$> H.query schema accessibleTables
|
||||
else encode <$> H.query schema accessibleTables
|
||||
return $ responseLBS status200 [jsonH] $ cs body
|
||||
|
||||
(ActionInappropriate, _, _) -> return $ responseLBS status405 [] ""
|
||||
|
||||
Reference in New Issue
Block a user