diff --git a/docs/list-of-diagnostics.md b/docs/list-of-diagnostics.md index 58874a8de585..e6195634513e 100644 --- a/docs/list-of-diagnostics.md +++ b/docs/list-of-diagnostics.md @@ -34,6 +34,7 @@ | __`ASP0026`__ | [Authorize] overridden by [AllowAnonymous] from farther away | | __`ASP0027`__ | Unnecessary public Program class declaration | | __`ASP0028`__ | Consider using ListenAnyIP() instead of Listen(IPAddress.Any) | +| __`ASP0029`__ | Experimental warning for validations resolver APIs | ### API (`API1000-API1003`) diff --git a/src/Http/Http.Abstractions/src/Validation/IValidatableInfo.cs b/src/Http/Http.Abstractions/src/Validation/IValidatableInfo.cs index 91766f69cfc1..d2a7ccd1fbcf 100644 --- a/src/Http/Http.Abstractions/src/Validation/IValidatableInfo.cs +++ b/src/Http/Http.Abstractions/src/Validation/IValidatableInfo.cs @@ -1,11 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace Microsoft.AspNetCore.Http.Validation; /// /// Represents an interface for validating a value. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public interface IValidatableInfo { /// diff --git a/src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs b/src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs index b4d4abe31c2d..80a2f0d0d748 100644 --- a/src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs +++ b/src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs @@ -10,6 +10,7 @@ namespace Microsoft.AspNetCore.Http.Validation; /// Provides an interface for resolving the validation information associated /// with a given or . /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public interface IValidatableInfoResolver { /// diff --git a/src/Http/Http.Abstractions/src/Validation/RuntimeValidatableParameterInfoResolver.cs b/src/Http/Http.Abstractions/src/Validation/RuntimeValidatableParameterInfoResolver.cs index e2d3e6ffc5c8..0728c3ac8b8d 100644 --- a/src/Http/Http.Abstractions/src/Validation/RuntimeValidatableParameterInfoResolver.cs +++ b/src/Http/Http.Abstractions/src/Validation/RuntimeValidatableParameterInfoResolver.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs b/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs index 58895fc00014..9fba8ab854b4 100644 --- a/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs +++ b/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs @@ -4,12 +4,14 @@ using System.Collections; using System.ComponentModel.DataAnnotations; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace Microsoft.AspNetCore.Http.Validation; /// /// Contains validation information for a parameter. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public abstract class ValidatableParameterInfo : IValidatableInfo { private RequiredAttribute? _requiredAttribute; diff --git a/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs b/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs index f6dfe94e688b..167d54500466 100644 --- a/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs +++ b/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs @@ -10,6 +10,7 @@ namespace Microsoft.AspNetCore.Http.Validation; /// /// Contains validation information for a member of a type. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public abstract class ValidatablePropertyInfo : IValidatableInfo { private RequiredAttribute? _requiredAttribute; diff --git a/src/Http/Http.Abstractions/src/Validation/ValidatableTypeAttribute.cs b/src/Http/Http.Abstractions/src/Validation/ValidatableTypeAttribute.cs index 0ea382c59a55..a36402ecc408 100644 --- a/src/Http/Http.Abstractions/src/Validation/ValidatableTypeAttribute.cs +++ b/src/Http/Http.Abstractions/src/Validation/ValidatableTypeAttribute.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace Microsoft.AspNetCore.Http.Validation; /// @@ -8,6 +10,7 @@ namespace Microsoft.AspNetCore.Http.Validation; /// validations generator. /// [AttributeUsage(AttributeTargets.Class)] +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public sealed class ValidatableTypeAttribute : Attribute { } diff --git a/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs b/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs index a20f0ec8a800..82ae03465f9b 100644 --- a/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs +++ b/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs @@ -11,6 +11,7 @@ namespace Microsoft.AspNetCore.Http.Validation; /// /// Contains validation information for a type. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public abstract class ValidatableTypeInfo : IValidatableInfo { private readonly int _membersCount; diff --git a/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs b/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs index a78ca7cabfb5..3e02c35a4722 100644 --- a/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs +++ b/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; namespace Microsoft.AspNetCore.Http.Validation; /// /// Represents the context for validating a validatable object. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public sealed class ValidateContext { /// diff --git a/src/Http/Http.Abstractions/src/Validation/ValidationOptions.cs b/src/Http/Http.Abstractions/src/Validation/ValidationOptions.cs index d27ba37eaf13..dc83ce9282a7 100644 --- a/src/Http/Http.Abstractions/src/Validation/ValidationOptions.cs +++ b/src/Http/Http.Abstractions/src/Validation/ValidationOptions.cs @@ -19,6 +19,7 @@ public class ValidationOptions /// Source-generated resolvers are typically inserted at the beginning of this list /// to ensure they are checked before any runtime-based resolvers. /// + [Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public IList Resolvers { get; } = []; /// @@ -35,6 +36,7 @@ public class ValidationOptions /// When this method returns, contains the validation information for the specified type, /// if the type was found; otherwise, null. /// true if validation information was found for the specified type; otherwise, false. + [Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public bool TryGetValidatableTypeInfo(Type type, [NotNullWhen(true)] out IValidatableInfo? validatableTypeInfo) { foreach (var resolver in Resolvers) @@ -56,6 +58,7 @@ public bool TryGetValidatableTypeInfo(Type type, [NotNullWhen(true)] out IValida /// When this method returns, contains the validation information for the specified parameter, /// if validation information was found; otherwise, null. /// true if validation information was found for the specified parameter; otherwise, false. + [Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public bool TryGetValidatableParameterInfo(ParameterInfo parameterInfo, [NotNullWhen(true)] out IValidatableInfo? validatableInfo) { foreach (var resolver in Resolvers) diff --git a/src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs b/src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs index 77a128842ea4..bc4f6a77abaf 100644 --- a/src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs +++ b/src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs @@ -25,7 +25,9 @@ public static IServiceCollection AddValidation(this IServiceCollection services, configureOptions(options); } // Support ParameterInfo resolution at runtime +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. options.Resolvers.Add(new RuntimeValidatableParameterInfoResolver()); +#pragma warning restore ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. }); return services; } diff --git a/src/Http/Http.Abstractions/test/Validation/ValidatableInfoResolverTests.cs b/src/Http/Http.Abstractions/test/Validation/ValidatableInfoResolverTests.cs index 6960162a13c5..ab197cf6fde8 100644 --- a/src/Http/Http.Abstractions/test/Validation/ValidatableInfoResolverTests.cs +++ b/src/Http/Http.Abstractions/test/Validation/ValidatableInfoResolverTests.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/Http/Http.Abstractions/test/Validation/ValidatableParameterInfoTests.cs b/src/Http/Http.Abstractions/test/Validation/ValidatableParameterInfoTests.cs index c89f182c92f9..e10614b2b19e 100644 --- a/src/Http/Http.Abstractions/test/Validation/ValidatableParameterInfoTests.cs +++ b/src/Http/Http.Abstractions/test/Validation/ValidatableParameterInfoTests.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs b/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs index 2a4c82e704e5..98e74bd9d32a 100644 --- a/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs +++ b/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs b/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs index 73a0271eee8b..b929819c5915 100644 --- a/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs +++ b/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs @@ -37,6 +37,7 @@ private static string Emit(InterceptableLocation addValidation, ImmutableArray //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.ValidatableType.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.ValidatableType.cs index 4628c9574004..0ddc3613249f 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.ValidatableType.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.ValidatableType.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. @@ -12,6 +14,8 @@ public partial class ValidationsGeneratorTests : ValidationsGeneratorTestBase public async Task CanValidateTypesWithAttribute() { var source = """ +#pragma warning disable ASP0029 + using System; using System.ComponentModel.DataAnnotations; using System.Collections.Generic; @@ -374,4 +378,4 @@ async Task ValidInputProducesNoWarnings(IValidatableInfo validatableInfo) } }); } -} \ No newline at end of file +} diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGeneratorTestBase.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGeneratorTestBase.cs index 2310c2c3aaf9..bb1cd12470d3 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGeneratorTestBase.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGeneratorTestBase.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs index 16e4957dd2ae..046365541efa 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs index 82b35b51711d..5babdce85f26 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs index 2c1052c8f20a..ddd57a0dc8b6 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs index 9549ef313872..d435bf7996f2 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs index 4c0a10963495..2a5085a534a9 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs index 3b04d8843a8b..7fb61484070f 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs index 7eea5401c9c1..03f948521855 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs index aa1862d646c5..75c87732a0d1 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs index d67637d110a8..c5a4eb4152bf 100644 --- a/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/Http/Http/perf/Microbenchmarks/ValidatableTypesBenchmark.cs b/src/Http/Http/perf/Microbenchmarks/ValidatableTypesBenchmark.cs index 75abf445ec30..973d22ed0674 100644 --- a/src/Http/Http/perf/Microbenchmarks/ValidatableTypesBenchmark.cs +++ b/src/Http/Http/perf/Microbenchmarks/ValidatableTypesBenchmark.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/Http/Routing/src/RouteEndpointDataSource.cs b/src/Http/Routing/src/RouteEndpointDataSource.cs index 59bcd699a59d..cbdac85e3e8c 100644 --- a/src/Http/Routing/src/RouteEndpointDataSource.cs +++ b/src/Http/Routing/src/RouteEndpointDataSource.cs @@ -239,7 +239,9 @@ private RouteEndpointBuilder CreateRouteEndpointBuilder( // Initialize this route endpoint builder with validation convention if validation options // are registered and validation is not disabled on the endpoint. +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. var hasValidationResolvers = builder.ApplicationServices.GetService>() is { Value: { } options } && options.Resolvers.Count > 0; +#pragma warning restore ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. var hasDisableValidationMetadata = builder.Metadata.OfType().FirstOrDefault() is not null; if (hasValidationResolvers && !hasDisableValidationMetadata) { diff --git a/src/Http/Routing/src/ValidationEndpointFilterFactory.cs b/src/Http/Routing/src/ValidationEndpointFilterFactory.cs index 0e75ea640fa9..bd9b841fd556 100644 --- a/src/Http/Routing/src/ValidationEndpointFilterFactory.cs +++ b/src/Http/Routing/src/ValidationEndpointFilterFactory.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/Http/samples/MinimalValidationSample/Program.cs b/src/Http/samples/MinimalValidationSample/Program.cs index 91be84ed0978..9afcebfb2b02 100644 --- a/src/Http/samples/MinimalValidationSample/Program.cs +++ b/src/Http/samples/MinimalValidationSample/Program.cs @@ -26,7 +26,9 @@ app.Run(); // Define validatable types with the ValidatableType attribute +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [ValidatableType] +#pragma warning restore ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. public class Customer { [Required]