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
{{ message }}
Repository navigation
Map<String, dynamic> as an Endpoint Parameter #3231
Currently, Serverpod restricts Map parameters in endpoint methods to strictly typed maps (e.g., Map<String, int?>, Map<String, String?>, etc.). This limitation prevents the direct use of dynamic JSON objects—such as those produced by jsonDecode()—which makes it challenging to handle cases where payloads may vary or be invalid. As a result, when a client sends an incorrect payload, the system returns a generic Serverpod log error rather than a tailored response that could improve error handling and client feedback.
Proposal
Add support for passing a Map<String, dynamic> as an endpoint parameter.
Use Case
If a client sends a payload with an unexpected structure or incorrect data types, I currently only receive a generic Serverpod log error. With the ability to pass Map<String, dynamic>, I could:
Directly pass JSON-decoded maps to my endpoints.
Validate the payload within the endpoint.
Return custom, meaningful error messages to the client, improving the overall API experience.
Alternatives
No
Additional context
No response
How experienced are you with this library?
Expert - Experienced and comfortable with using this library in complex projects
Activity