Closed DDDHuang closed 3 years ago
It's been a long long time since I delved in this project, but… have you tried with…
GlobalSpec = #{openapi => undefined, swagger => "2.0" , info => #{title => "minirest example API"}},
application:set_env(cowboy_swagger, global_spec, GlobalSpec).
…?
Also… what does cowboy_swagger:swagger_version()
return after you run that set_env/3
call?
Ues
GlobalSpec = #{openapi => undefined, swagger => "2.0" , info => #{title => "minirest example API"}},
application:set_env(cowboy_swagger, global_spec, GlobalSpec).
successed, Thank you.
but cowboy_swagger:swagger_version()
, this function not exported.
And I think openapi => undefined
should removed, it is puzzling that undefined...
So my pr https://github.com/inaka/cowboy_swagger/pull/133
Aaaand merged!
It is difficult to add .config file in our project, so I set global spec by
case i need swagger2.0 to support
consumes
field, likeBut it seem not work.
I try to access http://localhost:8088/api-docs/swagger.json and get return:
the
"openapi":"3.0.0"
and"swagger":"2.0"
both exist.PS: I hope it to start as a launcher function, maybe as like: