Closed atancasis closed 3 years ago
Thank you for the kind words.
You might want to join #perl-openapi on irc.freenode.net if you have further questions. A two way dialog for these kinds of questions could be better.
Understood, thanks again @jhthorsen, much appreciated! I'll close this issue in this case.
Let me first preface this issue with a statement that the current behavior of how these methods behave might be a result of design convictions taken for this Plugin (in the case of
OPTIONS
) and/or a limitation or design conviction of Mojolicious (in the case ofHEAD
), so please don't hesitate to let me know if this behavior are either intended and this issue is invalid OR if it's valid but non-trivial to fix.Without explicit operation objects defined as path item objects for
options
andhead
, it appears that these routes are automatically vivified.This behavior, however, appears to only apply for the
OPTIONS
andHEAD
methods, whereas HTTP 404 are correctly being returned for every other method without specifications.Outlined below is a test suite illustrating this behavior:
Whereby:
Specifically:
When
OPTIONS
is invoked, the application returns the OAS —which I understand might be a design conviction or feature of the plugin itself, but took me by surprise.When
HEAD
is invoked, I understand in this section of the Mojolicious routing guide that there's a caveat on this method:But thought I should check and ask if both of these behaviors are to be expected or if there's a way to coerce the plugin to NOT autovivify these operation paths unless explicitly specified and defined in the OAS.
In the spirit of completeness and fairness however, it should be noted that both these endpoints, despite being autovivified or installed with default handlers, still operate in a reasonable manner, wherein:
OPTIONS
return the OASHEAD
behaves as outlined in the Mojolicious routing guide that even though it might not be discerned fromGET
, returns an empty response bodyOnce again, thanks for the excellent excellent plugin and work that has been done on this plugin. Just wanted to express that this plugin is heavily used in our core platforms for more than a year now and is by far, from my estimate, the most advanced or feature-rich, even across language and evaluating the ecosystem as a whole, in terms of bootstrapping applications from OAS.
Please don't hesitate to let me know if there's any additional details and/or clarifications that I can provide. Thanks!