Skip to content
New issue

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

[Uptime] Require type check object for API requests #60395

Open
justinkambic opened this issue Mar 17, 2020 · 1 comment
Open

[Uptime] Require type check object for API requests #60395

justinkambic opened this issue Mar 17, 2020 · 1 comment
Assignees
Labels
Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability technical debt Improvement of the software architecture and operational architecture

Comments

@justinkambic
Copy link
Contributor

Describe the feature:
As noted in #59881 (comment) - we could provide runtime checking and automatic type population for all of our gets.

As part of #59881, we are providing an optional parameter so callers can supply an io-ts object that implements the Decoder 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.

@justinkambic justinkambic added technical debt Improvement of the software architecture and operational architecture Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability labels Mar 17, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants