Skip to content

Provide a common package to replace Pydantic models #128

@khvn26

Description

@khvn26

Rationale

Since flagsmith-engine does not export the Pydantic models representing Flagsmith entities anymore, we need a common package to avoid manually synchronising the schemas across their consumers (currently, Core and Edge API).

As part of this work, we are decoupling the internal DynamoDB schemas from the publicly available Environment Document API schema and removing the Pydantic dependency as a strict requirement for consuming them.

Requirements

Provide a Python package that includes the following:

  • A set of types representing DynamoDB-stored Flagsmith documents.
  • No third-party dependencies, except for type_extensions. This is to enable maximum portability for edge runtimes.

The package should NOT include mapping and validation logic.
The types should be usable by Pydantic type adapters where possible (i.e., the Core API).
The package should be installable independently of each other as Python package extras.

Use cases

Environment Documents

The DynamoDB schema is identical to the EnvironmentModel Pydantic class.

Operation Target/source Consumer
Write DynamoDB Flagsmith/flagsmith
Read DynamoDB Flagsmith/edge-api

Environment API key Documents

Operation Target/source Consumer
Write DynamoDB Flagsmith/flagsmith
Read DynamoDB Flagsmith/flagsmith
Read DynamoDB Flagsmith/edge-api

Identities

Operation Target/source Consumer
Write DynamoDB Flagsmith/flagsmith
Write DynamoDB Flagsmith/edge-api
Read DynamoDB Flagsmith/flagsmith
Read DynamoDB Flagsmith/edge-api

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions