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
First of all, awesome lib. I've been using it in a couple of projects that already reached production and so far it's been delightful.
I noticed an error during a little refactoring I was doing (due to an issue on typescript-rest-swagger to be honest) that killed my entire API (local unit testing, of course):
When using @PathParam (an presumably other decorators) on class methods that do not have an http method decorator, ServerContainer.buildServices() would try to include those methods as part of the API... resulting in an error (somewhat expected) because the method does not have the proper declaration as an http method:
@Path('/some')classSomeController{privatesomeHelper(@PathParam('oops')oops: string){return`we throw invalid http method ${oops}`;}
@GETpublicget(){return'what do you know?';}}
While the problem here is kinda obvious to me now, the error thrown at runtime didn't help much:
Error: Invalid http method for service [/some]
Reading this make you think "well, let's check out SomeController.get() to see if somethings' wrong" and stare at it without much idea about what's wrong, because in fact nothing's wrong in the particular method that should process GET requests.
I'm not pretty sure what would be a good way to improve this experience.
The text was updated successfully, but these errors were encountered:
Hi!
First of all, awesome lib. I've been using it in a couple of projects that already reached production and so far it's been delightful.
I noticed an error during a little refactoring I was doing (due to an issue on
typescript-rest-swagger
to be honest) that killed my entire API (local unit testing, of course):When using
@PathParam
(an presumably other decorators) on class methods that do not have an http method decorator,ServerContainer.buildServices()
would try to include those methods as part of the API... resulting in an error (somewhat expected) because the method does not have the proper declaration as an http method:While the problem here is kinda obvious to me now, the error thrown at runtime didn't help much:
Reading this make you think "well, let's check out
SomeController.get()
to see if somethings' wrong" and stare at it without much idea about what's wrong, because in fact nothing's wrong in the particular method that should process GET requests.I'm not pretty sure what would be a good way to improve this experience.
The text was updated successfully, but these errors were encountered: