diff --git a/readme.md b/readme.md index 4f73616..d5658dc 100644 --- a/readme.md +++ b/readme.md @@ -54,7 +54,7 @@ However, this name can be overridden using `[assembly: ImmediateAssemblyIdentifi ### Customizing the endpoints #### AsParameters -By default on POST and PUT requests Immediate.Apis will assume that your request class should be treated as a `[FromBody]`. Sometimes, however, this is not desired. For example imagine a PUT request that sits at a route `/api/todos/{id}` and updates a TODO with a given ID. We would want to get the `id` from the route and the properties to update from the body. To do so, we need to create the following request command class: +By default on POST, PUT, and PATCH requests Immediate.Apis will assume that your request class should be treated as a `[FromBody]`. Sometimes, however, this is not desired. For example imagine a PUT request that sits at a route `/api/todos/{id}` and updates a TODO with a given ID. We would want to get the `id` from the route and the properties to update from the body. To do so, we need to create the following request command class: ```cs public sealed record Command diff --git a/src/Immediate.Apis.Analyzers/CustomizeGroupUsageAnalyzer.cs b/src/Immediate.Apis.Analyzers/CustomizeGroupUsageAnalyzer.cs index eb68c9a..4a8b3a3 100644 --- a/src/Immediate.Apis.Analyzers/CustomizeGroupUsageAnalyzer.cs +++ b/src/Immediate.Apis.Analyzers/CustomizeGroupUsageAnalyzer.cs @@ -11,7 +11,7 @@ public sealed class CustomizeGroupUsageAnalyzer : DiagnosticAnalyzer new( id: DiagnosticIds.IAPI0011CustomizeGroupInvalid, title: "`CustomizeGroup` requires a specific definition", - messageFormat: "`CustomizeGroup` must be `private static void CustomizeEndpoint(RouteGroupBuilder group)`", + messageFormat: "`CustomizeGroup` must be `private static void CustomizeGroup(RouteGroupBuilder group)`", category: "ImmediateApis", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, diff --git a/src/Immediate.Apis.Analyzers/DiagnosticIds.cs b/src/Immediate.Apis.Analyzers/DiagnosticIds.cs index d46a936..de837ae 100644 --- a/src/Immediate.Apis.Analyzers/DiagnosticIds.cs +++ b/src/Immediate.Apis.Analyzers/DiagnosticIds.cs @@ -11,7 +11,6 @@ internal static class DiagnosticIds public const string IAPI0007MissingTransformResultMethod = "IAPI0007"; public const string IAPI0008HandlerShouldNotDependOnEndpoint = "IAPI0008"; public const string IAPI0009EndpointHasBeenSpecifiedMultipleTimes = "IAPI0009"; - public const string IAPI0010InvalidRouteGroupName = "IAPI0010"; public const string IAPI0011CustomizeGroupInvalid = "IAPI0011"; public const string IAPI0012MissingCustomizeGroupMethod = "IAPI0012"; public const string IAPI0013InvalidMapGroupTarget = "IAPI0013"; diff --git a/tests/Immediate.Apis.Tests/Utility.cs b/tests/Immediate.Apis.Tests/Utility.cs index b26f349..f4ed6f1 100644 --- a/tests/Immediate.Apis.Tests/Utility.cs +++ b/tests/Immediate.Apis.Tests/Utility.cs @@ -76,23 +76,6 @@ public static TheoryData Methods() => "Delete", ]; - public static TheoryData ValidRouteGroupNames => - [ - "_TestGroup", - "Test_Group", - "Test123Group", - "123TestGroup", - ]; - - public static TheoryData InvalidRouteGroupNames => - [ - "", - "Test.Group", - "Test Group", - "Test@Group", - "Test#Group", - ]; - public static SettingsTask VerifyIgnoreImmediateHandlers(GeneratorDriverRunResult result, [CallerFilePath] string sourceFile = "") => Verify(result, sourceFile: sourceFile) .IgnoreGeneratedResult(gsr => ImmediateHandlersHintName().IsMatch(Path.GetFileName(gsr.HintName)))