Open nenadmitrovic opened 4 years ago
It looks like you're looking for params in the wrong spot here (fn [{:keys [params]}] ...)
. If you're sending parameters as a body of the request via POST, then you'd need to do (fn [{{params :body} :parameters}] ...)
instead. You also need to let Reitit know what the parameters are for it to be able to generate the Swagger UI. This is done by specifying the :parameters
key, e.g:
{:parameters {:body {:x int?, :y int?}}
:responses {200 {:body {:total int?}}}
:handler (fn [{{params :body} :parameters}] ...)}}
I recommend looking at the docs here for more info.
Ok. Thank you very much. I will check the docs too.
I am trying to access my Swagger service endpoints. Here is the code:
Here is my project.clj:
But when I tried to access http://localhost:3000/api/swagger.json in browser I got this response:
I can't figure out why did I get this in json format and why not see Swagger UI to visaulize and interact with my services? I expect to see something like this: https://ibb.co/TYNT6SG