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

Use actual types for api responses, not ad-hoc json!() objects #1931

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

coolreader18
Copy link
Collaborator

Description of Changes

No behavior change, but it feels important to be able to see the actual structure of the response, especially as we're stabilizing.

Expected complexity level and risk

1

Testing

Was not able to get spacetime-web working to test this, but it's the same schema as it was before, and it matches with the typedef in typescript in spacetime-web.

@bfops bfops added the release-any To be landed in any release window label Nov 4, 2024
@gefjon gefjon self-requested a review November 14, 2024 18:57
Copy link
Contributor

@gefjon gefjon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a significant improvement in code quality. Please coordinate with @PuruVJ to make sure the website still works, and double-check that the "Internal Tests" passes after you rebase-onto or merge-from master.

In the extremely unlikely/basically impossible event that serializing
json fails, `axum::Json::into_response()` will return a Response with a
500 status code. Explicitly specifying `StatusCode::OK` will overwrite
that, returning a 200 even when the response is an error message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-any To be landed in any release window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants