You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to make openapi server implementation revisable? #118
Hi there, I cannot get Revise work together with OpenAPI.jl generated code and corresponding handler implementation.
Is this is just not supported? (Or may I just be confused and it works for others seamlessly?)
Revise should work, but it needs you to use invokelatest on your side. Revise does update your handler. The problem is the running server uses the method version that the server task started with. HTTP.jl 1.x hid this by calling every handler through Base.invokelatest whereas HTTP.jl 2.x, which OpenAPI.jl 1.x uses, does not.
The right way to do it now it to wrap the generated handlers with Base.invokelatest for register!. It is not the default anymore because Base.invokelatest cannot be compiled with Julia's --trim option, and we want generated servers to stay usable there.
using Revise
includet("Handlers.jl")
include("ExampleServer.jl")
router = HTTP.Router()
ExampleServer.register!(router, Handlers;
middleware = h -> (request -> Base.invokelatest(h, request)))
server = HTTP.serve!(router, "127.0.0.1", 8080)
Activity
tanmaykm commentedon Sep 19, 2026
Revise should work, but it needs you to use
invokelateston your side. Revise does update your handler. The problem is the running server uses the method version that the server task started with. HTTP.jl 1.x hid this by calling every handler throughBase.invokelatestwhereas HTTP.jl 2.x, which OpenAPI.jl 1.x uses, does not.The right way to do it now it to wrap the generated handlers with
Base.invokelatestforregister!. It is not the default anymore becauseBase.invokelatestcannot be compiled with Julia's --trim option, and we want generated servers to stay usable there.