Wire RestAPI OBS3004 path validation and OBS3005 on R3#65
Conversation
1、Report OBS3004 when path placeholders do not match method parameters 2、Report OBS3005 (not OBS3003) when R3 generator sees IObservable return types 3、Add generator test for OBS3004 Closes #60
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c733b28. Configure here.
| DiagnosticDescriptors.PathParameterMismatch, | ||
| methodSymbol.Locations.FirstOrDefault(), | ||
| methodSymbol.Name)); | ||
| } |
There was a problem hiding this comment.
Path validation rejects valid APIs
High Severity
ValidatePathTemplate treats path {placeholder} names and method parameters as sets that must match exactly via SetEquals, counting every parameter except CancellationToken by parameter.Name. The RestAPI runtime in RestMethodInfoInternal still binds extra parameters as query values, body/header/property parameters via attributes, and path tokens using AliasAs with case-insensitive names—so many interfaces that compile and run today will now fail with OBS3004.
Reviewed by Cursor Bugbot for commit c733b28. Configure here.


Summary
{placeholder}names against method parameters (OBS3004)IObservable<T>Test plan
GetUser_path_parameter_mismatch_reports_OBS3004generator testCloses #60
Note
Low Risk
Compile-time generator diagnostics only; no runtime API or auth changes.
Overview
The RestAPI source generator now validates HTTP route paths on attributed methods:
{placeholder}segments must match the method’s parameters exactly (excludingCancellationToken), or it reports OBS3004.For the R3 generator flavor,
IObservable<T>on an interface now emits OBS3005 (SystemReactiveNotReferenced) instead of the generic unsupported-return diagnostic, steering users toward the Reactive package.A generator test asserts OBS3004 when the path has
{id}but the method has extra parameters.Reviewed by Cursor Bugbot for commit c733b28. Configure here.