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
But it seems this validation isn't applied when used for query params:
// SearchParams, query params are used for a gettypeQueryParamsstruct {
Limitint32`query:"limit" validate:"required,gte=1"`// Must be Greater Than or Equal to 1.
}
//encore:api auth method=POST path=/svc/endpointfunc (s*Service) MyQueryParamEndpoint(ctx context.Context, req*QueryParams) (res*Response, errerror) {
...
Just wondering if the auto-validating functionality mentioned at https://encore.dev/docs/develop/validation could be extended to query params too, or whether it's an intentional choice to not validate these, and only validate payloads?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I've been using the
Validate()
function to validate my requests, like:But it seems this validation isn't applied when used for query params:
Just wondering if the auto-validating functionality mentioned at https://encore.dev/docs/develop/validation could be extended to query params too, or whether it's an intentional choice to not validate these, and only validate payloads?
🙏
Beta Was this translation helpful? Give feedback.
All reactions