OpenAPI.NET.OData
OpenAPI.NET.OData copied to clipboard
Tag contain only entiy set name
In Net.Core 2.x swagger generated OpenApi paths contained tags only with entity set name i.e. controller name. It was very convenient for grouping all paths by Entity set.
TagDepth settings does not do what I whant.
How can add this feature? To Add new settings to OpenApiConvertSettings?
Go ahead with the new setting and let's have a discussion based on your draft.
@senyaMur Actually, what i though is to use the Dependency Injection to inject all the element generator/provider. Then, customer can override the default implement and provide their own.
I'd like to refactor the whole codes when i have better design.
Can you show example code where customer overriding the default implement?
Did you mean
var context = new ODataContext(edmModel);
context.OperationHanderProvider = NewOperationHanderProvider; // Override OperationHandler
Right?
@SenyaMur yes. That's part of my original thought. But, that's not finished yet and not productive.
So, i agree to add a config into the setting and enable your requirement.
Thank you @xuzhg ! May be to create tags generation for change behaivour in one point?
I basically done this after document generation.
foreach (var path in document.Paths.Values)
{
foreach (var operation in path.Operations.Values)
{
// Fix overblown tag names
foreach (var tag in operation.Tags)
tag.Name = tag.Name.Split('.').First();
}
}