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

整理: 204 path operation の Response 明示返り値を削除 #1237

Merged
merged 6 commits into from
May 22, 2024

Conversation

tarepan
Copy link
Contributor

@tarepan tarepan commented May 12, 2024

内容

概要: 204 path operation の Response 明示返り値を削除してリファクタリング

FastAPI の path operation で 204 No Content を表現する場合、path operation デコレータで status_code=204 を指定すれば関数では return するだけでよい。
しかし現在の実装では Response(status_code=204) を明示的に返しており、これは二重管理である。二重管理はバグの温床 (ref #1236) である。
また path operation 関数の型付けが Response となって他 path operations との一貫性を失わせている。

このような背景から、204 path operation の Response 明示返り値を削除してリファクタリングすることを提案します。

関連 Issue

無し

@tarepan tarepan requested a review from a team as a code owner May 12, 2024 08:25
@tarepan tarepan requested review from Hiroshiba and removed request for a team May 12, 2024 08:25
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

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

LGTM!!

変更ありがとうございます!

@Hiroshiba Hiroshiba merged commit f281190 into VOICEVOX:master May 22, 2024
4 checks passed
@tarepan tarepan deleted the refactor/204 branch May 22, 2024 16:02
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

Successfully merging this pull request may close these issues.

2 participants