Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions services/brig/src/Brig/API/Public/Swagger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,31 +129,6 @@ emptySwagger =
& S.info . S.description
?~ "There is no Swagger documentation for this version. Please refer to v5 or later."

{- FUTUREWORK(fisx): there are a few things that need to be fixed before this schema collection
is of any practical use!

- `ToSchema` instances of team notifications are wrong. To do this right, search
schema-profunctor tutorial for bind/dispatch, and consult conversation events for
examples.

- swagger2 doesn't handle types with the same name from different models well; it silently
drops the second definition, which is what you want only if there are no name clashes as
in our case with three types called `Event` and three types called `EventType`. We have
solved this by rendering the three event types seperately and returning each
declarations list in a super-list. For a better work-around, check
https://github.com/GetShopTV/swagger2/issues/14.

- The different `EventData` constructors all have different json schema that partially
overlap. Our schemas only represent the union of all those constructors, rather than a
list of cases. There may be a better way even in swagger v2:
https://swagger.io/specification/v2/ (look for "polymorphism")

- (wire cloud) expose end-point via nginz (only on staging).

- Document how this works in
https://docs.wire.com/understand/api-client-perspective/swagger.html

tracked in https://wearezeta.atlassian.net/browse/FS-1008 -}
eventNotificationSchemas :: [S.Definitions S.Schema]
eventNotificationSchemas = fst . (`S.runDeclare` mempty) <$> renderAll
where
Expand Down