Open phtrivier opened 5 years ago
Which versions of plug, phoenix and elixir are you on? I’ll try to reproduce this issue.
I'm using phoenix 1.34 and plug 1.6.4. That being said, I would not be surprised if it was somehow linked to one of my swagger definitions, but the lack of logs make it hard to check...
I have the same problem...
Resolving Hex dependencies... Dependency resolution completed: Unchanged: .... phoenix 1.3.4 _phoenix_ecto 3.6.0 phoenix_html 2.12.0 phoenix_live_reload 1.1.7 phoenixpubsub 1.1.1 plug 1.7.1 ...
My problems seem to be even worse, I have basically the same umbrella setup, I have to use 0.7 to get any kind of feedback, and when I can get it to work by explicitly adding the -r
and -e
options all I ever get is an empty file:
{
"swagger": "2.0",
"paths": {},
"info": {
"version": "1.0",
"title": "My API"
},
"host": "localhost:4000",
"definitions": {}
}
I am on Phoenix 1.4.0, plug 1.7.1, plug_cowboy 2.0.1
Edit: I looks like you need to add swagger_definitions
functions to the controllers to get any kind of output? That is not clear from the docs.
Edit2: hmm, I still don't see any paths in my swagger.json...
Edit 3: oh you need swagger_path
macros?
I too had the same issue followed this medium article to implement swagger. Except that I used the latest version of PhoenixSwagger, and the swagger.json file is not being generated.
My other dependency versions are as follows, phoenix - 1.3.3, phoenix_ecto - 3.2 phoenix_html 2.10 phoenix_pubsub - 1.0
Then I downgraded PhoenixSwagger to 0.6.2 and now it works fine.
@shijithkjayan did you add the required configuration?, added in version 0.8:
https://github.com/xerions/phoenix_swagger/blob/master/CHANGELOG.md#080
I think this issue might be touching on the one I just submitted, #237.
I have no paths ("paths":{}
) in my umbrella app.
same problem now
I have an umbrella project where one of the applications is a phoenix project. I updated the version of
phoenix_swagger
in the phx app from~> 0.7
to~> 0.8
. This downloaded version0.8.1
, after which I have two issues:mix test
in the phx app, some other application can not start, with an error message complaining aboutplug_cowboy
mix phx.swagger.generate -r MyApp.Router -e MyApp.Endpoint priv/static/endpoint.json
from the phx app, either nothing happens (no file is generated), or I get some nonsensical error:I can imagine it's pretty localized to my project, and
mix
is not exactly deterministic, so it might have broken my install beyond repair.However, no amount of
rm -rf _builds && rm -rf deps && mix deps.get && mix deps.compile && mix please.please.please.do.something
(which is my highly scientific elixir-compliant way of "working") seems to do the trick.So any idea how I could attack the problem, would help.
I'm sticking to 0.7.0 in the meantime.
Thanks !