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

Typesafe endpoint return types #5

Open
daemontus opened this issue Sep 27, 2023 · 0 comments
Open

Typesafe endpoint return types #5

daemontus opened this issue Sep 27, 2023 · 0 comments

Comments

@daemontus
Copy link
Member

Right now, all endpoints return OkResponse (or ErrResponse), which hold an arbitrary JSON string. Instead, it would be nice to have explicit types for some (all?) the endpoints, such that the objects can be automatically serialized through serde? For example, check_update_function could actually return Cardinality(f64) or ErrorMessage(String) instead of the generic response types.

This does not help that much on the JS side, since we have no type-checking there, but it helps future maintainers by clearly specifying what is/isn't a valid response from a particular endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant