-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using @Search()
controller method decorator hides any following endpoints
#12998
Closed
4 of 15 tasks
Labels
needs triage
This issue has not been looked into
Comments
found the issue - switch case missing handling of the export class RouterMethodFactory {
public get(target: HttpServer, requestMethod: RequestMethod): Function {
switch (requestMethod) {
case RequestMethod.POST:
return target.post;
case RequestMethod.ALL:
return target.all;
case RequestMethod.DELETE:
return target.delete;
case RequestMethod.PUT:
return target.put;
case RequestMethod.PATCH:
return target.patch;
case RequestMethod.OPTIONS:
return target.options;
case RequestMethod.HEAD:
return target.head;
case RequestMethod.GET:
return target.get;
default: {
return target.use;
}
}
}
} |
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 3, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 3, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 3, 2024
12 tasks
Let's track this here #13000 |
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 26, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 26, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 31, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 31, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 31, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 31, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 31, 2024
doronguttman
added a commit
to arnica-ext/nest
that referenced
this issue
Jan 31, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Current behavior
in a simple controller, have two or more endpoints (handlers), based on the order in the class, any endpoint following one decorated with
@Search()
will not be triggered, the handler decorated with the@Search()
would, even for nonSEARCH
requests.Minimum reproduction code
https://codesandbox.io/p/devbox/magical-williams-c5zs4n?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clqwve6g500073j6gbx3mr7c5%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clqwve6g500023j6gb1kzbvch%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clqwve6g500043j6gp6y6huez%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clqwve6g500063j6glp851voi%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clqwve6g500023j6gb1kzbvch%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clqwve6g400013j6gencroq7m%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522id%2522%253A%2522clqwve6g500023j6gb1kzbvch%2522%252C%2522activeTabId%2522%253A%2522clqwve6g400013j6gencroq7m%2522%257D%252C%2522clqwve6g500063j6glp851voi%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clqwve6g500053j6gbazdaozj%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522port%2522%253A3000%252C%2522path%2522%253A%2522%2522%257D%255D%252C%2522id%2522%253A%2522clqwve6g500063j6glp851voi%2522%252C%2522activeTabId%2522%253A%2522clqwve6g500053j6gbazdaozj%2522%257D%252C%2522clqwve6g500043j6gp6y6huez%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clqwve6g500033j6g33x48oe6%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522start%2522%257D%255D%252C%2522id%2522%253A%2522clqwve6g500043j6gp6y6huez%2522%252C%2522activeTabId%2522%253A%2522clqwve6g500033j6g33x48oe6%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D
Steps to reproduce
AppController
add a new method, ABOVE the existinggetHello()
method:GET http://localhost:3000
returns"SEARCH Hello World!"
instead of the default"Hello World!"
searchHello()
method below thegetHello()
method and see that both work as expected.Expected behavior
the
searchHello()
method should not execute forGET
requestsPackage
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
10.3.0
Packages versions
Node.js version
18.18.2
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: