Skip to content

Commit

Permalink
Fix obsolete constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed Jan 30, 2024
1 parent 091b3d1 commit 6b8b410
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Validation/DivergentResponseSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class DivergentResponseSchema : ValidationRule<OpenApiOperation>
{
private static readonly OpenApiSchemaComparer schemaComparer = new();
private static readonly HashSet<string> validStatusCodes = new(OpenApiOperationExtensions.SuccessCodes, StringComparer.OrdinalIgnoreCase);
public DivergentResponseSchema(GenerationConfiguration configuration) : base((context, operation) =>
public DivergentResponseSchema(GenerationConfiguration configuration) : base(nameof(DivergentResponseSchema),(context, operation) =>
{
var schemas = operation.GetResponseSchemas(validStatusCodes, configuration.StructuredMimeTypes);
if (schemas.GroupBy(x => x, schemaComparer).Count() > 1)
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Validation/GetWithBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Kiota.Builder.Validation;

public class GetWithBody : ValidationRule<OpenApiPathItem>
{
public GetWithBody() : base(static (context, pathItem) =>
public GetWithBody() : base(nameof(GetWithBody),static (context, pathItem) =>
{
if (pathItem.Operations.TryGetValue(OperationType.Get, out var getOperation) && getOperation.RequestBody != null)
context.CreateWarning(nameof(GetWithBody), "A GET operation with a body was found. The request body will be ignored.");
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Validation/InconsistentTypeFormatPair.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class InconsistentTypeFormatPair : ValidationRule<OpenApiSchema>
"null",
"object",
};
public InconsistentTypeFormatPair() : base(static (context, schema) =>
public InconsistentTypeFormatPair() : base(nameof(InconsistentTypeFormatPair),static (context, schema) =>
{
if (string.IsNullOrEmpty(schema?.Type) || string.IsNullOrEmpty(schema.Format) || KnownAndNotSupportedFormats.knownAndUnsupportedFormats.Contains(schema.Format) || escapedTypes.Contains(schema.Type))
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class KnownAndNotSupportedFormats : ValidationRule<OpenApiSchema>
"relative-json-pointer",
"regex",
};
public KnownAndNotSupportedFormats() : base(static (context, schema) =>
public KnownAndNotSupportedFormats() : base(nameof(KnownAndNotSupportedFormats),static (context, schema) =>
{
if (!string.IsNullOrEmpty(schema.Format) && knownAndUnsupportedFormats.Contains(schema.Format))
context.CreateWarning(nameof(KnownAndNotSupportedFormats), $"The format {schema.Format} is not supported by Kiota and the string type will be used.");
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Validation/MissingDiscriminator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Kiota.Builder.Validation;
public class MissingDiscriminator : ValidationRule<OpenApiDocument>
{
public MissingDiscriminator(GenerationConfiguration configuration) : base((context, document) =>
public MissingDiscriminator(GenerationConfiguration configuration) : base(nameof(MissingDiscriminator),(context, document) =>
{
var idx = new ConcurrentDictionary<string, ConcurrentDictionary<string, bool>>(StringComparer.OrdinalIgnoreCase);
document.InitializeInheritanceIndex(idx);
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Validation/MultipleServerEntries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Kiota.Builder.Validation;
public class MultipleServerEntries : ValidationRule<OpenApiDocument>
{
public MultipleServerEntries() : base(static (context, document) =>
public MultipleServerEntries() : base(nameof(MultipleServerEntries),static (context, document) =>
{
if (document.Servers.GroupBy(static x => x.Url, StringComparer.OrdinalIgnoreCase).Count() > 1)
context.CreateWarning(nameof(MultipleServerEntries),
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Validation/NoContentWithBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Kiota.Builder.Validation;

public class NoContentWithBody : ValidationRule<OpenApiOperation>
{
public NoContentWithBody() : base(static (context, operation) =>
public NoContentWithBody() : base(nameof(NoContentWithBody),static (context, operation) =>
{
if (operation.Responses.TryGetValue("204", out var response) && (response?.Content?.Any() ?? false))
context.CreateWarning(nameof(NoContentWithBody), "A 204 response with a body media type was found. The response body will be ignored.");
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Validation/NoServerEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Kiota.Builder.Validation;

public class NoServerEntry : ValidationRule<OpenApiDocument>
{
public NoServerEntry() : base(static (context, document) =>
public NoServerEntry() : base(nameof(NoServerEntry),static (context, document) =>
{
if (!document.Servers.Any() || string.IsNullOrEmpty(document.Servers.First().Url?.TrimEnd('/')))
context.CreateWarning(nameof(NoServerEntry),
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Validation/UrlFormEncodedComplex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class UrlFormEncodedComplex : ValidationRule<OpenApiOperation>
private static readonly StructuredMimeTypesCollection validContentTypes = new() {
"application/x-www-form-urlencoded",
};
public UrlFormEncodedComplex() : base(static (context, operation) =>
public UrlFormEncodedComplex() : base(nameof(UrlFormEncodedComplex),static (context, operation) =>
{
if (operation.GetRequestSchema(validContentTypes) is OpenApiSchema requestSchema)
ValidateSchema(requestSchema, context, operation.OperationId, "request body");
Expand Down

0 comments on commit 6b8b410

Please sign in to comment.