depth should reduce by one on each nesting level. Closes #2287.
Merge branch 'master' into version-3.1
Merge branch 'version-3.1' into model-serializer-api