In CM we have expandLinkDepth parameter, that will limit how many level of linked components are added to JSON.
However in web app DXA 2.0 during model mapping it fails, when link depth limit is reached in json. Error message:
Unable to map field 'SimilarBooks' to property Book.SimilarBooks of type ...
It fails on this line of BuildEntityModel method of DefaultModelBuilder, because SchemaId is null.
SemanticSchema semanticSchema = SemanticMapping.GetSchema(entityModelData.SchemaId, localization);
In CM we have expandLinkDepth parameter, that will limit how many level of linked components are added to JSON.
However in web app DXA 2.0 during model mapping it fails, when link depth limit is reached in json. Error message:
Unable to map field 'SimilarBooks' to property Book.SimilarBooks of type ...
It fails on this line of BuildEntityModel method of DefaultModelBuilder, because SchemaId is null.
SemanticSchema semanticSchema = SemanticMapping.GetSchema(entityModelData.SchemaId, localization);
More details here