We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With the following code (and elysia v1.2.25)
import { Elysia, t } from "elysia"; new Elysia() .guard( { response: { 403: t.String() }, }, (app) => app .get("/foo", () => "bar", { response: { 200: t.String() } }) .get("/bar", () => 12, { response: { 200: t.Integer() } }), ) .listen(3500);
doing curl localhost:3500/foo gives
curl localhost:3500/foo
{ "type": "validation", "on": "response", "summary": "Value should be one of 'integer', 'integer'", "property": "root", "message": "Expected union value", "expected": 0, "found": "bar", "errors": [ { "type": 62, "schema": { "anyOf": [ { "format": "integer", "default": 0, "type": "string" }, { "type": "integer" } ] }, "path": "", "value": "bar", "message": "Expected union value", "errors": [ { "iterator": {} }, { "iterator": {} } ], "summary": "Value should be one of 'integer', 'integer'" } ] }
while /bar works. Removing the response: { 403: t.String() } from the guard also makes this validation error go away.
/bar
response: { 403: t.String() }
It seems like the last response from the guard is used for every routes of it.
response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
With the following code (and elysia v1.2.25)
doing
curl localhost:3500/foo
giveswhile
/bar
works. Removing theresponse: { 403: t.String() }
from the guard also makes this validation error go away.It seems like the last
response
from the guard is used for every routes of it.The text was updated successfully, but these errors were encountered: