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
test('query validator withing HttpQuery', async () => { class Controller { @http.GET('do') async do( a: HttpQuery<string & MinLength<8>>, b: HttpQuery<string>, ) { return { valid: true }; } } const httpKernel = createHttpKernel([Controller]); expect((await httpKernel.request(HttpRequest.GET('/do').query('a=aaaaaaaa&b=bbbb'))).json).toMatchObject({ valid: true }); });
this should work, but fails since b parameter also gets the MinLength<8> validator attached. Error:
b
MinLength<8>
message": "Validation error: b(minLength): Min length is 8 caused by value "bbbb"
The text was updated successfully, but these errors were encountered:
fix/workaround is putting the validator outside of HttpQuery. likely related to type caches
@http.GET('do') async do( a: HttpQuery<string> & MinLength<8>, b: HttpQuery<string>, ) { return { valid: true }; }
Sorry, something went wrong.
chore(http): add failing test for #614
ab96f2f
No branches or pull requests
this should work, but fails since
b
parameter also gets theMinLength<8>
validator attached. Error:The text was updated successfully, but these errors were encountered: