-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async controller methods with "Async" suffix should not generate "AsyncAsync" #1730
Comments
async
controller methods with Async
suffix should not generate AsyncAsync
I usually use operationId without |
That way you are forcing me to use |
operationId has the benefit, that internal implementation details (name of controller method) is not faced to clients. xxxAsync suffix is for me technical restriction/pattern and API (operationIds) is business/client point of view. Separating the technical part from the client part seems being plausible. Of course it is some overhead for improved quality - depends on your scenario how much you want to invest into that. |
NSwag generates operation ids in the form controllerName_operationName where operationName is stripped off the Async suffix. Async should not be part of a spec as it is an implementation detail. How did you generate the spec? Can you post process it? |
Sorry guys, this was my bad. (If I remember correctly) I already had an Please close if you're fine with this behavior (I am). |
I think Async should not be in the operation id as it is an implementation of the used language (leaky abstraction), ie all operations are async and this its not needed |
Is it possible to make Adding Async at the end of a method as Settings option ? |
@baskialdensys please open a new issue for that |
A controller with
public async Task<ActionResult<Something>> GetSomethingAsync([Required] Guid foo)
becomes
System.Threading.Tasks.Task<Something> GetSomethingAsyncAsync(System.Guid foo);
For the generated code I'd also simply prefer
GetSomethingAsync
.The text was updated successfully, but these errors were encountered: