Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report error if base URL in example request is not in config #253

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ApiDoctor.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2570,7 +2570,7 @@ private static HttpRequest PreProcessUrlForSnippetGeneration(HttpRequest request
if (!(request.Url.Substring(0, 6).Equals("/beta/") || request.Url.Substring(0, 6).Equals("/v1.0/")))
{
//Log the error for the documentation to be fixed.
issues.Warning(ValidationErrorCode.InvalidUrlString, $"The url: {request.Url} does not start a supported api version( /v1.0/ or /beta/ ). File: {method.SourceFile}");
issues.Warning(ValidationErrorCode.InvalidUrlString, $"The url: {request.Url} does not start with a supported api version( /v1.0/ or /beta/ ). File: {method.SourceFile}");

if (method.SourceFile.DisplayName.Contains("beta"))
{
Expand Down
1 change: 1 addition & 0 deletions ApiDoctor.Publishing/CSDL/csdlextensionmethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public static string RequestUriPathOnly(this MethodDefinition method, IssueLogge
{
if (path.StartsWith(scheme, StringComparison.OrdinalIgnoreCase))
{
issues.For(method.Identifier).Error(ValidationErrorCode.InvalidUrlString, $"Unexpected base URL found in '{method.Request.FirstLineOnly()}'");
int pathStartIndex = path.IndexOf('/', scheme.Length);
if (pathStartIndex != -1)
{
Expand Down
Loading