-
-
Notifications
You must be signed in to change notification settings - Fork 421
Open
Description
In the More endpoints section of the chapter "Serving an API", we define a type:
type UserAPI2 = "users" :> Get '[JSON] [User]
:<|> "albert" :> Get '[JSON] User
:<|> "isaac" :> Get '[JSON] User
and then serve the data:
server2 :: Server UserAPI2
server2 = return users2
:<|> return albert
:<|> return isaac
This seems to be error-prone, as I could easily flip, by accident, the two lines :<|> return albert and :<|> return isaac . This would compile fine, leading to great awkwardness at runtime.
Is there a better way of doing this, especially when there are many endpoints?
Metadata
Metadata
Assignees
Labels
No labels