redis-om-python
redis-om-python copied to clipboard
Clarity on HashModel inside JsonModel
I believe, as per the datastructures redis supports here.
There was no intention of a HASH structure being allowed within a JSON formatted string. Especially since the latter is a new add-on meant for in-text searches using ReJSON & Redisearch.
If this is the case there should be type checks within the class to ensure that a nested structure of classes can only contain: JsonModel and EmbeddedJsonModel (Should it support multiple nesting since json does?).
If I stand corrected and Redis is in fact planning to somehow integrate both the datastructures in the future; Please ignore and close this.
If not, then I'm not sure how we can achieve this outside of a pydantic root_validator to check this during runtime. Open to suggestions!