Closed mendakon closed 2 days ago
私の開発環境で該当バージョン( 6de7c275221996011b03699a6f618909100cd44e )をチェックアウトして試したところ、APIコンソールとcurlでのリクエストは正常に完了しました。
# curlの例(bash)
curl -X POST -H "Content-Type: application/json" -d '{"id": "(省略)", "isSensitive": true, "i": "(省略)"}' localhost:3000/api/admin/emoji/update
postmanでは未確認です。
開発環境が絵文字一個という特殊な環境だったため絵文字を増やしてから実行したところ、該当エラーが再現できました。 https://github.com/misskey-dev/misskey/blob/d376aab45edc2170592a256a429a1d0b364bd7f5/packages/backend/src/core/CustomEmojiService.ts#L117 ここでnameがundefinedの検索が行われるのが原因と思われます。
パラメータから引き込んだnameがundefinedのときはsameNameEmojiの取得及び重複チェックをしないようにする必要がありそうですね
apiドキュメントの方は、このエンドポイントが「"id"か"name"のどちらかが必要」なのでどちらにもrequiredがつかない感じです。 それ用の表示があればいいんですが、ドキュメント生成は外部ライブラリに頼っているので改善は難しそうです
了解しました。ご対応ありがとうございました!!!
💡 Summary
例えば以下のようなjsonで
POST:admin/emoji/updateを使用して絵文字更新を行おうとすると、
というエラーが出る。
のような形式ですべての項目を指定すると正常に更新できる
あと、apiドキュメントに、requiredの項目が存在しないのが気になる。(画像参照)意図的にそうしている可能性もありそうですが 赤丸のどれかがrequiredになるべきなのでは?
🥰 Expected Behavior
例え以下のようなjsonで
部分的な指定でも正常にアップデートが行える
🤬 Actual Behavior
部分指定で、
POST:admin/emoji/updateを使用して絵文字更新を行おうとすると、
というエラーが出る。
📝 Steps to Reproduce
💻 Frontend Environment
🛰 Backend Environment (for server admin)
Do you want to address this bug yourself?