Previously, a model derived from an empty model couldn't be used in a place that asked for the empty model. In general, we had a lot of substitutability issues (just with our typing).
This commit fixes that by bringing back what was previously known as "$nonEmptyObject", but improves on it by not having it be as pervasive as it was previously (for example, it would show up on models that had props).
What does this PR do and why?
Fixes #2186
This PR fixes regressions introduced (by me! 😅) in the previous major release that attempted to remove $nonEmptyObject from all types. Little did we know, it did support stricter typing in some cases.
This PR reintroduces a similar concept, but it does so in a far more limited form to fix the aforementioned issue.
Steps to validate locally
The test is a good example, and validating would simply be running the type checker.
Previously, a model derived from an empty model couldn't be used in a place that asked for the empty model. In general, we had a lot of substitutability issues (just with our typing).
This commit fixes that by bringing back what was previously known as "$nonEmptyObject", but improves on it by not having it be as pervasive as it was previously (for example, it would show up on models that had props).
What does this PR do and why?
Fixes #2186
This PR fixes regressions introduced (by me! 😅) in the previous major release that attempted to remove
$nonEmptyObject
from all types. Little did we know, it did support stricter typing in some cases.This PR reintroduces a similar concept, but it does so in a far more limited form to fix the aforementioned issue.
Steps to validate locally
The test is a good example, and validating would simply be running the type checker.