Skip to content

Commit

Permalink
Check if method is not null before adding annotations to CSDL (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
millicentachieng authored Mar 5, 2024
1 parent 40e1964 commit 3b6262e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ApiDoctor.Publishing/CSDL/csdlwriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,12 @@ private static Dictionary<string, List<IODataAnnotatable>> GenerateLinkAndRestri
}

var verb = method.HttpMethodVerb();
if (string.IsNullOrWhiteSpace(verb))
continue;

var restrictionTerm = GetRestrictionTermForMethod(verb);
if (string.IsNullOrWhiteSpace(restrictionTerm))
continue;

bool targetExists = targets.TryGetValue(path, out var targetAnnotations);
IODataAnnotatable readAnnotatable = targetAnnotations?
Expand Down
2 changes: 1 addition & 1 deletion ApiDoctor.Validation/Tags/TagProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public string Preprocess(FileInfo sourceFile, IssueLogger issues)
var (_, processedContent) = DocFile.ParseAndRemoveYamlFrontMatter(includeContent, issues,true);

// removing Markdown lint and new lines from the beginning of markdown content since it breaks table structure if include link is within table
processedContent = MarkdownLintFormat.Replace(processedContent, "").TrimStart(Environment.NewLine.ToCharArray());
processedContent = MarkdownLintFormat.Replace(processedContent, "").Trim();

writer.WriteLine(nextLine.Replace(includePath, processedContent));
}
Expand Down

0 comments on commit 3b6262e

Please sign in to comment.