Closed slifty closed 2 months ago
I tried GET opportunities/555555555555555555555555555555 and got this response: { "name": "DatabaseError", "message": "Unexpected database error.", "details": [ { "length": 168, "name": "error", "severity": "ERROR", "code": "22003", "where": "unnamed portal parameter $1 = '...'", "file": "numutils.c", "line": "314", "routine": "pg_strtoint32" } ] } Which is fine and probably not a new error at all, but would be nice to make it a 400 since we don't support IDs greater than 2^32-1.
I tried GET opportunities/555555555555555555555555555555 and got this response:
GET opportunities/555555555555555555555555555555
{ "name": "DatabaseError", "message": "Unexpected database error.", "details": [ { "length": 168, "name": "error", "severity": "ERROR", "code": "22003", "where": "unnamed portal parameter $1 = '...'", "file": "numutils.c", "line": "314", "routine": "pg_strtoint32" } ] }
Which is fine and probably not a new error at all, but would be nice to make it a 400 since we don't support IDs greater than 2^32-1.
_Originally posted by @bickelj in https://github.com/PhilanthropyDataCommons/service/pull/967#discussion_r1583490515_
We can easily add this to the isId validator function which should harden all our endpoints at once.
isId
_Originally posted by @bickelj in https://github.com/PhilanthropyDataCommons/service/pull/967#discussion_r1583490515_
We can easily add this to the
isId
validator function which should harden all our endpoints at once.