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

Merged
merged 4 commits into from
Jan 21, 2025

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
@coolreader18 coolreader18 force-pushed the noa/formalize-json-responses branch from 99d70ed to 5361630 Compare November 12, 2024 16:43
@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.

@coolreader18 coolreader18 force-pushed the noa/formalize-json-responses branch from 5361630 to 0c08479 Compare November 14, 2024 19:24
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.
@coolreader18 coolreader18 force-pushed the noa/formalize-json-responses branch from b94800a to 086c171 Compare January 17, 2025 18:24
@coolreader18 coolreader18 added this pull request to the merge queue Jan 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 17, 2025
@coolreader18 coolreader18 added this pull request to the merge queue Jan 21, 2025
Merged via the queue into master with commit 7c6af12 Jan 21, 2025
9 checks passed
@coolreader18 coolreader18 deleted the noa/formalize-json-responses branch February 11, 2025 02:53
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