Typed request extraction, responses, and OpenAPI export for MoonBack.
moon update
moon fmt --check . example/serve.mbtx
moon check --target wasm
moon test --target wasm
moon build example --target wasm
moon check --target native
moon test --target native
moon build example --target native
moon infoimpl FromRequest for Unitimpl ToResponse for Unitimpl ToResponse for Stringimpl ToResponse for Jsonimpl ToResponse for StringViewpub suberror OpenApiError {
InvalidPath(String)
InvalidSchema(String)
DuplicateOperation(String)
}type Requesttype Responsetype Routerfn[Ctx, Req : FromRequest, Res : ToResponse] Router::add(self : Router, path : String, meth : RequestMethod, handler : async (Ctx, Req) -> Res, ctx : Ctx, schema? : RouteSchema[Req, Res]) -> Unitfn[Ctx, Req : FromRequest, Res : ToResponse] Router::delete(self : Router, path : String, handler : async (Ctx, Req) -> Res, ctx : Ctx, schema? : RouteSchema[Req, Res]) -> Unitfn Router::generate_openapi(self : Router, title~ : String, version~ : String) -> Json raise OpenApiErrorfn[Ctx, Req : FromRequest, Res : ToResponse] Router::get(self : Router, path : String, handler : async (Ctx, Req) -> Res, ctx : Ctx, schema? : RouteSchema[Req, Res]) -> Unitfn[Ctx, Req : FromRequest, Res : ToResponse] Router::head(self : Router, path : String, handler : async (Ctx, Req) -> Res, ctx : Ctx, schema? : RouteSchema[Req, Res]) -> Unitfn[Ctx, Req : FromRequest, Res : ToResponse] Router::patch(self : Router, path : String, handler : async (Ctx, Req) -> Res, ctx : Ctx, schema? : RouteSchema[Req, Res]) -> Unitfn[Ctx, Req : FromRequest, Res : ToResponse] Router::post(self : Router, path : String, handler : async (Ctx, Req) -> Res, ctx : Ctx, schema? : RouteSchema[Req, Res]) -> Unitfn[Ctx, Req : FromRequest, Res : ToResponse] Router::put(self : Router, path : String, handler : async (Ctx, Req) -> Res, ctx : Ctx, schema? : RouteSchema[Req, Res]) -> Unittype SchemaContext