What about creating 2 different route one with id and another without it and calling your handler from both route as shown below:
(defn handler
([] "Response without id")
([id] (str "Response with id - " id)))
(defroutes my-routes
(ANY "myres" [] (handler))
(ANY "myres/:id" [id] (handler id)))