Closed Veltro-pm closed 5 years ago
Thanks for the bug report! My first instinct was that the bug had to be in OpenAPI::Client, but the issue was that Mojo::Promise inside Security.pm
used a different IOLoop when called from OpenAPI::Client than the singleton. I've rewritten the code now, so it does not require an IOLoop at all.
@jberger: Not sure if you want to have a look at the diff. Unfortunately, I haven't written any new tests, but such an test would simply check that the code does not use Mojo::Promise or Mojo::IOLoop::Delay, so I'm not sure how useful it is.
Going to make a new release soon.
Hello, I tried to use securityDefinitions to adapt your example https://mojolicious.io/blog/2017/12/22/day-22-how-to-build-a-public-rest-api/
Problem description: In the case of using
perl .\script\my_app openapi ...
the callback is getting called twice and the morbo+curl approach shows the line "Nothing has been rendered ..."May be related:
40
82
I've added "securityDefinitions" and "security" to my yaml:
and adapted my code:
Note: In the following [datetime] removed from the debugging lines for readability:
Without security: [{"dummy": []}] (runs as expected)
With security: [{"dummy": []}] (cb twice)
Then I tried to use morbo and curl:
Without security: [{"dummy": []}] (runs as expected)
With security: [{"dummy": []}] (Nothing has been rendered ... although the output is correct)
Am I doing something wrong?