Open andreeapurta opened 4 months ago
You can achieve this by:
public class MyOperationsIdTest : IOperationProcessor
{
public bool Process(OperationProcessorContext context)
{
SetOperationId(context);
return true;
}
private static void SetOperationId(OperationProcessorContext context)
{
//insert your rules here
context.OperationDescription.Operation.OperationId = context.MethodInfo.Name;
}
private static string GetOperationIdPrefix(string operationId)
{
return new string(operationId.TakeWhile(char.IsLetter).ToArray());
}
services.AddOpenApiDocument(
options =>
{
options.OperationProcessors.Add(new MyOperationsIdTest());
..........
however some are duplicated...like GetById1,GetById2..
Hello all! Prevously I was using for a project Swashbuckle.AspNetCore for generating my swagger.json file. Now I started using NSwag for this. Is there any way I can achieve the following configuration of OperationId in NSwag? (without MANUALLY adding any annotation on the controllers' methods)
Swashbuckle.AspNetCore AddSwaggerGen configuration: