@@ -7,7 +7,7 @@ import Data.Maybe (Maybe(..))
77import Effect (Effect)
88import Type.Function (type (#))
99import Type.Proxy (Proxy(..))
10−import Yoga.HTTP.API.Path (Path, Lit, Capture, type (:), type (/))
10+import Yoga.HTTP.API.Path (Path, Lit, Capture, type (:), type (/), type (:?))
1111import Yoga.HTTP.API.Route (GET, POST, PUT, DELETE, Route, Request, buildOpenAPISpec)
1212import Yoga.HTTP.API.Route.Auth (BearerToken, ApiKeyHeader, BasicAuth)
1313import Yoga.HTTP.API.Route.Encoding (JSON, PlainText, XML)
@@ -27,19 +27,13 @@ type ComprehensiveAPI =
2727
2828 , -- List users with query parameters
2929 listUsers ::
30− Route GET (Path (Lit "users"))
31− ( Request
32− { query ::
33− { limit :: Int # Example "10"
34− , offset :: Int # Example "0"
35− }
36− }
37− )
30+ Route GET (Path (Lit "users") :? { limit :: Int # Example "10", offset :: Int # Example "0" })
31+ (Request {})
3832 (ok :: { body :: Array User })
3933
4034 , -- POST with JSON body and schema
4135 createUser ::
42− Route POST (Path (Lit "users"))
36+ Route POST "users"
4337 (Request { body :: JSON (Schema "CreateUserRequest" CreateUserRequest) })
4438 (created :: { body :: Schema "User" User })
4539