Skip to content

Commit

Permalink
Merge pull request #37686 from dotnet/AddMissingConfigurationAndOptio…
Browse files Browse the repository at this point in the history
…nsSourceGenDiagnostics
  • Loading branch information
tarekgh authored Oct 24, 2023
2 parents beeb420 + 4a1f938 commit 923b2a7
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
42 changes: 40 additions & 2 deletions docs/fundamentals/syslib-diagnostics/source-generator-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ The following table provides an index to the `SYSLIB1XXX` diagnostics in .NET 6
| [SYSLIB1100][1100] | Type is not supported. |
| [SYSLIB1101][1101] | Property on type is not supported. |
| [SYSLIB1102][1102] | Project's language version must be at least C# 11. |
| [SYSLIB1103][1103] | (Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.) |
| [SYSLIB1104][1104] | (Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.) |
| [SYSLIB1103][1103] | Value types are invalid inputs to configuration 'Bind' methods. |
| [SYSLIB1104][1104] | Generator cannot determine the target configuration type. |
| [SYSLIB1105][1105] | (Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.) |
| [SYSLIB1106][1106] | (Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.)(Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.) |
| [SYSLIB1107][1107] | (Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.) |
Expand All @@ -138,6 +138,25 @@ The following table provides an index to the `SYSLIB1XXX` diagnostics in .NET 6
| [SYSLIB1116][1116] | (Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.) |
| [SYSLIB1117][1117] | (Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.) |
| [SYSLIB1118][1118] | (Reserved for Microsoft.Extensions.Configuration.Binder.SourceGeneration.) |
| [SYSLIB1201][1201] | Can't use `ValidateObjectMembersAttribute` or `ValidateEnumeratedItemsAttribute` on fields or properties with open generic types. |
| [SYSLIB1202][1202] | A member type has no fields or properties to validate. |
| [SYSLIB1203][1203] | A type has no fields or properties to validate. |
| [SYSLIB1204][1204] | A type annotated with `OptionsValidatorAttribute` doesn't implement the necessary interface. |
| [SYSLIB1205][1205] | A type already includes an implementation of the 'Validate' method. |
| [SYSLIB1206][1206] | Can't validate private fields or properties. |
| [SYSLIB1207][1207] | Member type is not enumerable. |
| [SYSLIB1208][1208] | Validators used for transitive or enumerable validation must have a constructor with no parameters. |
| [SYSLIB1209][1209] | `OptionsValidatorAttribute` can't be applied to a static class. |
| [SYSLIB1210][1210] | Null validator type specified for the `ValidateObjectMembersAttribute` or `ValidateEnumeratedItemsAttribute` attributes. |
| [SYSLIB1211][1211] | Unsupported circular references in model types. |
| [SYSLIB1212][1212] | Member potentially missing transitive validation. |
| [SYSLIB1213][1213] | Member potentially missing enumerable validation. |
| [SYSLIB1214][1214] | Can't validate constants, static fields, or properties. |
| [SYSLIB1215][1215] | Validation attribute on the member is inaccessible from the validator type. |
| [SYSLIB1216][1216] | C# language version not supported by the options validation source generator. |
| [SYSLIB1217][1217] | The validation attribute is only applicable to properties of type string, array, or `ICollection`; it cannot be used with other types. |
| [SYSLIB1218][1218] | (Reserved for Microsoft.Extensions.Options.SourceGeneration.) |
| [SYSLIB1219][1219] | (Reserved for Microsoft.Extensions.Options.SourceGeneration.) |

<!-- Include adds ## Suppress warnings (H2 heading) -->
[!INCLUDE [suppress-source-generator-diagnostics](includes/suppress-source-generator-diagnostics.md)]
Expand Down Expand Up @@ -251,3 +270,22 @@ The following table provides an index to the `SYSLIB1XXX` diagnostics in .NET 6
[1116]: syslib1100-1118.md
[1117]: syslib1100-1118.md
[1118]: syslib1100-1118.md
[1201]: syslib1201-1219.md
[1202]: syslib1201-1219.md
[1203]: syslib1201-1219.md
[1204]: syslib1201-1219.md
[1205]: syslib1201-1219.md
[1206]: syslib1201-1219.md
[1207]: syslib1201-1219.md
[1208]: syslib1201-1219.md
[1209]: syslib1201-1219.md
[1210]: syslib1201-1219.md
[1211]: syslib1201-1219.md
[1212]: syslib1201-1219.md
[1213]: syslib1201-1219.md
[1214]: syslib1201-1219.md
[1215]: syslib1201-1219.md
[1216]: syslib1201-1219.md
[1217]: syslib1201-1219.md
[1218]: syslib1201-1219.md
[1219]: syslib1201-1219.md
2 changes: 2 additions & 0 deletions docs/fundamentals/syslib-diagnostics/syslib1100-1118.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ The following table shows the diagnostic IDs for configuration binder source-gen
| `SYSLIB1100` | Type is not supported. |
| `SYSLIB1101` | Property on type is not supported. |
| `SYSLIB1102` | Project's language version must be at least C# 11. |
| `SYSLIB1103` | Value types are invalid inputs to configuration 'Bind' methods. |
| `SYSLIB1104` | Generator cannot determine the target configuration type. |
28 changes: 28 additions & 0 deletions docs/fundamentals/syslib-diagnostics/syslib1201-1219.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: SYSLIB diagnostics for Microsoft.Extensions.Options.SourceGeneration
description: Learn about the options validation source-generation analyzers that generate compile-time suggestions SYSLIB1201 through SYSLIB1219.
ms.date: 10/24/2023
---
# SYSLIB diagnostics for options validation source generation

The following table shows the diagnostic IDs for options validation source-generation analyzers in .NET 8 and later versions.

| Diagnostic ID | Description |
| - | - |
| `SYSLIB1201` | Can't use `ValidateObjectMembersAttribute` or `ValidateEnumeratedItemsAttribute` on fields or properties with open generic types. |
| `SYSLIB1202` | A member type has no fields or properties to validate. |
| `SYSLIB1203` | A type has no fields or properties to validate. |
| `SYSLIB1204` | A type annotated with `OptionsValidatorAttribute` doesn't implement the necessary interface. |
| `SYSLIB1205` | A type already includes an implementation of the 'Validate' method. |
| `SYSLIB1206` | Can't validate private fields or properties. |
| `SYSLIB1207` | Member type is not enumerable. |
| `SYSLIB1208` | Validators used for transitive or enumerable validation must have a constructor with no parameters. |
| `SYSLIB1209` | `OptionsValidatorAttribute` can't be applied to a static class. |
| `SYSLIB1210` | Null validator type specified for the `ValidateObjectMembersAttribute` or `ValidateEnumeratedItemsAttribute` attributes. |
| `SYSLIB1211` | Unsupported circular references in model types. |
| `SYSLIB1212` | Member potentially missing transitive validation. |
| `SYSLIB1213` | Member potentially missing enumerable validation. |
| `SYSLIB1214` | Can't validate constants, static fields or properties. |
| `SYSLIB1215` | Validation attribute on the member is inaccessible from the validator type. |
| `SYSLIB1216` | C# language version not supported by the options validation source generator. |
| `SYSLIB1217` | The validation attribute is only applicable to properties of type string, array, or `ICollection`; it cannot be used with other types. |
3 changes: 3 additions & 0 deletions docs/navigate/tools-diagnostics/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1751,6 +1751,9 @@ items:
- name: SYSLIB1100-SYSLIB1118
href: ../../fundamentals/syslib-diagnostics/syslib1100-1118.md
displayProperty: syslib1101, syslib1102, syslib1103, syslib1104, syslib1105, syslib1106, syslib1107, syslib1108, syslib1109, syslib1110, syslib1111, syslib1112, syslib1113, syslib1114, syslib1115, syslib1116, syslib1117, syslib1118
- name: SYSLIB1201-SYSLIB1219
href: ../../fundamentals/syslib-diagnostics/syslib1201-1219.md
displayProperty: syslib1201, syslib1202, syslib1203, syslib1204, syslib1205, syslib1206, syslib1207, syslib1208, syslib1209, syslib1210, syslib1211, syslib1212, syslib1213, syslib1214, syslib1215, syslib1216, syslib1217, syslib1218, syslib1219
- name: Package validation
items:
- name: Get started
Expand Down

0 comments on commit 923b2a7

Please sign in to comment.