-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
APIでリクエストするフィールドを限定できるようにする(軽量化) #11029
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
Comments
Related #4635 |
こちらのフィールドの属性を未指定にした場合どうなることが想定されているのでしょうか?… |
@pantasystem 未指定で全フィールドが出る(現状と変わらない)を想定していますので後方互換性は問題ないかと |
実際にやってみた kakkokari-gtyih@fe6f91b |
BotなどがMisskey APIを利用する際にも、特定のフィールドの情報以外要らないようなケースはありそうなので、出番自体はありそうですね |
SQL的に考えると、joinするテーブルの数が減るなら効果がありそう |
v2として作るのが良いと思います。Twitterもv2から似たような仕組みが備わったと記憶しています |
Summary
APIリクエストにて、取りたいフィールドを限定できるようにすることで、レスポンスを小さく、クライアント側の処理を軽くできるようにする
とくにPlayとかでは、現状Playのリストを取りたいだけのユースケースであっても、AiScript本体も同時に帰ってくるので、この機能の実装によりかなりの軽量化が期待できる
実装例(
flash/featured
)Payload
Response
The text was updated successfully, but these errors were encountered: