[Uptime] Require type check object for API requests #60395
Labels
Team:Uptime - DEPRECATED
Synthetics & RUM sub-team of Application Observability
technical debt
Improvement of the software architecture and operational architecture
Describe the feature:
As noted in #59881 (comment) - we could provide runtime checking and automatic type population for all of our
get
s.As part of #59881, we are providing an optional parameter so callers can supply an
io-ts
object that implements theDecoder
interface, which will be used to parse the response and log an error if the type does not correspond to the data.To resolve this issue, that decoder parameter should become required, and all calling code will provide a type decoder when it makes API requests.
Describe a specific use case for the feature:
Today in Uptime, all of our API responses are essentially unchecked
any
, and it's been up to the calling code to perform validation themselves.With this change, we would provide type decoders for all existing API requests, and any new ones would be required to implement a validator as part of their changes. This will give us better runtime stability, and make a nicer development experience because we will have increased reliance on static typing.
The text was updated successfully, but these errors were encountered: