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
I currently have a single version of an api with the following resources which contains endpoints for creating a product, retrieving all etc. v1/productsv1/orders.
In order to support this I have a controller attributes like @Route('v1/products'). I now need a new version of my api, products endpoints need a breaking change so I have a new controller for that and the appropriate functions with the @Route('v2/products') attribute.
The orders endpoint never changes except for the version. So I was hoping to add another attribute with the new version which would mean two route attributes are added but I get the following error Only one Route decorator allowed. I could duplicate the controller code and update the route but this added a lot of duplicate code.
Whats the best mechanism to support multiple versions for a controller?
Sorting
I am submitting a support ticket to understand if the preferred mechanism to support this
bug report
feature request
support request
I confirm that I
used the search to make sure that a similar issue hasn't already been submit
Expected Behavior
Ability to add another Route attribute to identify a given controller should work for multiple routes.
Current Behavior
Adding another Route attribute Only one Route decorator allowed
Possible Solution
Assuming support of multiple Route attribute / accept an array. There might be better solutions that currently exist.
The text was updated successfully, but these errors were encountered:
I currently have a single version of an api with the following resources which contains endpoints for creating a product, retrieving all etc.
v1/products
v1/orders
.In order to support this I have a controller attributes like
@Route('v1/products')
. I now need a new version of my api, products endpoints need a breaking change so I have a new controller for that and the appropriate functions with the@Route('v2/products')
attribute.The orders endpoint never changes except for the version. So I was hoping to add another attribute with the new version which would mean two route attributes are added but I get the following error
Only one Route decorator allowed
. I could duplicate the controller code and update the route but this added a lot of duplicate code.Whats the best mechanism to support multiple versions for a controller?
Sorting
I am submitting a support ticket to understand if the preferred mechanism to support this
I confirm that I
Expected Behavior
Ability to add another Route attribute to identify a given controller should work for multiple routes.
Current Behavior
Adding another Route attribute
Only one Route decorator allowed
Possible Solution
Assuming support of multiple Route attribute / accept an array. There might be better solutions that currently exist.
The text was updated successfully, but these errors were encountered: