jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
54 stars 44 forks source link

Mojolicious::Lite silently ignores controller configurations due to missing default namespaces #246

Closed XSven closed 3 months ago

XSven commented 1 year ago
<Mojolicious::Lite application> eval -V 'app->routes->namespaces'
[]

Actual behavior

No information about my incomplete setup was provided. As a Mojolicious newbie this was an annoying experience.

jhthorsen commented 1 year ago

I'm not sure what you want. Are you expecting something else than 404 Not Found?

XSven commented 1 year ago

I have properly configured the OpenAPI plugin using the op_spec_to_route attribute and I have used the location suggested by the mojo tool (at the time the Mojolicious::Lite was created) to store the controller. I am missing a warning that tells me that the configuration is incomplete due to

<Mojolicious::Lite application> eval -V 'app->routes->namespaces'
[]

or even better the Controller location suggested by the mojo tool should be a member of the namespaces array.

jhthorsen commented 3 months ago

I don't know how to do that. I will consider a PR though.