Headless API Swashbuckle

Swagger is already installed by default in Litium 7.4 and you only need to add some extra decoration and classes.

On the classes, or the base class, for your API controllers, add the ApiCollection attribute.

    [ApiCollection("site")]
    public abstract class ApiControllerBase : ApiController
    {
    }

Add an extra configuration file like the following, the Collection property should return the same value as you enter in the ApiCollection-attribute.

    public class SiteOpenApiCollection : IApiCollection
    {
        internal const string _collectionName = "site";

        public string Name { get; } = "Accelerator Web API";
        public string Collection => _collectionName;

        public void Configure(OpenApiDocumentBuilder builder)
        {
        }

        public bool IsAuthorized() => true;
    }

Compile the solution and enter https://yourdomain/Litium/swagger and your defined collection will be visible in the dropdown to the right in top-bar.