misskey-rs icon indicating copy to clipboard operation
misskey-rs copied to clipboard

Recognize pack parameters in model types

Open coord-e opened this issue 5 years ago • 0 comments

Some of the current model types are based on the "packed" representation in misskey. There are pack functions that take parameters, and the form of the packed representation returned depends on the parameter.

https://github.com/syuilo/misskey/blob/ec4d5857d80938758ce64930159be2c941d4e30f/src/models/repositories/user.ts#L147-L154

Currently, we do not take these parameters into account, and we deal with it by using Option to fields that depends on the parameter. Since this approach misses quite a lot of invariants, it is expected to introduce a model type that statically considers the pack parameter.

coord-e avatar Dec 26 '20 05:12 coord-e