Search code examples
asp.net-web-apiswaggerfast-endpoints

FastEndPoints swagger endpoint grouping name lower case issue


I'm using fastendpoints for my latest project. In designing endpoints I face following issue.

enter image description here

just note that simple case in substring "Roles".

Here is how I configure the endpoint

enter image description here

Does anyone have an idea of how to fix this lowercase issue? Thanks in advance.


Solution

  • you have two options.

    1.) the default behavior is to convert the group/tag names to title case. which can be changed like so:

    .SwaggerDocument(o => o.TagCase = TagCase.None);
    

    2.) or you can specify per endpoint what the actual tag/group should be for that endpoint. which will override the auto detected route segment based tag value:

    public override void Configure()
    {
        Get("OperationalRoles/{ClientId}");
        Description(x => x.AutoTagOverride("Operational Roles"));
    }
    

    alternatively you can turn off the route/path segment based auto tagging and specify what tag the endpoint belongs to per endpoint like so:

    .SwaggerDocument(o => o.AutoTagPathSegmentIndex = 0);
    
    public override void Configure()
    {
        Description(x => x.WithTags("Operational Roles"));
    }