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

fix(server): http error parsing on endpoints without a default response #12927

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented Sep 25, 2024

Fixes #10166

You can see in the open api spec, that this endpoint did not have a default resopnse, so open-api assumed it was a string and did not parse the response. This is why handleError was unable to extract the message correctly.

This PR fixes that parsing, but also adds a default response for this endpoint (returns messageId).

Before After
image image

Comment on lines +3494 to +3500
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TestEmailResponseDto"
}
}
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously no default response type.

@@ -2220,7 +2223,10 @@ export function addMemoryAssets({ id, bulkIdsDto }: {
export function sendTestEmail({ systemConfigSmtpDto }: {
systemConfigSmtpDto: SystemConfigSmtpDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchText("/notifications/test-email", oazapfts.json({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed from fetchText to fetchJson

@jrasm91 jrasm91 merged commit 005528a into main Sep 25, 2024
36 checks passed
@jrasm91 jrasm91 deleted the fix/10166 branch September 25, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] - Better smtp error
2 participants