-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Currently, in order to use serializer classes imported from flagsmith-common in strictly typed codebases, we have to use type: ignore or cast created/updated instances to target model types.
We should look into the following:
- Add a
TypeVartoSerializerWithMetadataso subclasses can be annotated as e.g.class FeatureSerializerWithMetadata(SerializerWithMetadata[Feature], CreateFeatureSerializerin the consuming code. - In
common.typesmodule, try to import the Core API models underif TYPE_CHECKING, and only use type aliases tomodel.Modelif they are not available.
emyller and Zaimwa9