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

json-schema/user.tsalsoKnownAsプロパティの定義が不正確 #10724

Closed
okayurisotto opened this issue Apr 27, 2023 · 1 comment
Closed
Labels
⚠️bug? This might be a bug

Comments

@okayurisotto
Copy link
Contributor

💡 Summary

backendのmodels/json-schema/user.tsにおけるpackedUserDetailedNotMeOnlySchemaalsoKnownAsプロパティの定義が不正確です。配列として定義されているalsoKnownAsプロパティはformatプロパティを取ることができないはずです。おそらくやりたかったことの正しい実装としては、alsoKnownAsitemsプロパティとしてtype: 'string'なオブジェクトを作り、そのオブジェクトに対しformatプロパティを定義するというものだと推測します。

この不正確な書き方はアカウントマイグレーションを実装するPR #10507 で追加されました。

backendでの不正確な定義:

alsoKnownAs: {
type: 'array',
format: 'uri',
nullable: true,
optional: false,
},

Misskey.js側の型定義:

alsoKnownAs: string[];

JSON Schemaでのformatの使い方:https://json-schema.org/understanding-json-schema/reference/string.html#format

🥰 Expected Behavior

正しい定義がされている。

🤬 Actual Behavior

誤った定義がされている。

📝 Steps to Reproduce

📌 Environment

Misskey version: 5124db5 (13.11.3)
Your OS:
Your browser:


私のフォークの方で修正作業を進めています。

@okayurisotto
Copy link
Contributor Author

マージされたのでクローズします。ありがとうございました!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

No branches or pull requests

1 participant