You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phoenix.Router.resources defines both a PATCH route and a PUT route for the :update operation. In your controller, you will only have one function for both routes, and that means, you will only define api/3 for either PATCH or PUT. This will lead BlueBird to emit a warning about missing documentation for the other method.
The text was updated successfully, but these errors were encountered:
I don't think it's possible to get intel about whether a route was defined via the resources macro. That leaves us with three options:
We leave it as it is and tell our users to ignore the warnings. I wouldn't like that.
We check whether a PATCH route also has a PUT route which was described with the api/3 macro and vice versa. If so, we suppress the warning. In this case, we might have false negatives if an api really handles PATCH and PUT differently. It's not ideal, but at least we get helpful warnings in most cases without annoying users with false warnings.
We remove the warnings altogether. But I found those warnings helpful already, so I'd like to keep them.
I don't like to suppress or ignore warnings either. But we should be able to determine if a route for :put also exists for :patch and vice versa. What do you think about creating the docs for the "undocumented", but yet existing route, automatically? Provided the route is tested.
As for creating docs for routes without documentation: It would be possible, of course, but we would also have to extract the parameters automatically, because otherwise they wouldn't be displayed in the generated docs. That would make the use of the macros optional. In that case, the warnings should be removed.
This is a fundamental question. Do we want a package that requires explicit documentation and helps you find gaps in your application? Or do we want a package that builds a basic documentation for you out-of-the-box, with the option of adding more descriptions and information as needed, but potentially leading you to treat your documentation half-heartedly?
Phoenix.Router.resources
defines both a PATCH route and a PUT route for the:update
operation. In your controller, you will only have one function for both routes, and that means, you will only defineapi/3
for either PATCH or PUT. This will lead BlueBird to emit a warning about missing documentation for the other method.The text was updated successfully, but these errors were encountered: