fix: OpenAPI now tags a FK correctly on O2O relationships

This commit is contained in:
Laurence Isla
2024-04-18 17:08:14 -05:00
committed by Steve Chavez
parent 1bf0c54dd6
commit 0d13b842a6
3 changed files with 17 additions and 0 deletions
+15
View File
@@ -222,6 +222,21 @@ spec actualPgVersion = describe "OpenAPI" $ do
. nth 0
liftIO $ tableTag `shouldBe` Just [aesonQQ|"authors_only"|]
it "includes a fk description for a O2O relationship" $ do
r <- simpleBody <$> get "/"
let referralLink = r ^? key "definitions" . key "first" . key "properties" . key "second_id_1"
liftIO $
referralLink `shouldBe` Just
[aesonQQ|
{
"format": "integer",
"type": "integer",
"description": "Note:\nThis is a Foreign Key to `second.id`.<fk table='second' column='id'/>"
}
|]
describe "Foreign table" $
it "includes foreign table properties" $ do