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
+1
View File
@@ -115,6 +115,7 @@ makeProperty tbl rels col = (colName col, Inline s)
-- Finds the relationship that has a single column foreign key
rel = find (\case
Relationship{relCardinality=(M2O _ relColumns)} -> [colName col] == (fst <$> relColumns)
Relationship{relCardinality=(O2O _ relColumns)} -> [colName col] == (fst <$> relColumns)
_ -> False
) relsSortedByIsView
fCol = (headMay . (\r -> snd <$> relColumns (relCardinality r)) =<< rel)