diff --git a/src/core/EdFi.DataManagementService.Core/ApiService.cs b/src/core/EdFi.DataManagementService.Core/ApiService.cs index 2047338dc..bd6f73e28 100644 --- a/src/core/EdFi.DataManagementService.Core/ApiService.cs +++ b/src/core/EdFi.DataManagementService.Core/ApiService.cs @@ -290,12 +290,12 @@ public JsonArray GetDependencies() foreach (JsonNode projectSchemaNode in projectSchemaNodes) { - var resourceSchemasObj = projectSchemaNode["resourceSchemas"]!.AsObject().Select(x => new ResourceSchema(x.Value!)); + var resourceSchemas = projectSchemaNode["resourceSchemas"]?.AsObject().Select(x => new ResourceSchema(x.Value!)).ToList()!; Dictionary> dependencies = - resourceSchemasObj!.ToDictionary(rs => rs.ResourceName.Value, rs => new List()); + resourceSchemas.ToDictionary(rs => rs.ResourceName.Value, rs => new List()); - foreach (var resourceSchema in resourceSchemasObj) + foreach (var resourceSchema in resourceSchemas) { foreach (var documentPath in resourceSchema.DocumentPaths.Where(d => d.IsReference)) { @@ -317,7 +317,7 @@ public JsonArray GetDependencies() int RecursivelyDetermineDependencies(string resourceName, int depth) { - + // Code Smell here: // These resources are similar to abstract base classes, so they are not represented in the resourceSchemas // portion of the schema document. This is a rudimentary replacement with the most specific version of the resource if (resourceName == "EducationOrganization")