# Headless API Swashbuckle

**URL:** <https://forum.litium.com/t/headless-api-swashbuckle/1459>\
**Category:** Questions\
**Created:** [April 29, 2020, 9:11am UTC](https://forum.litium.com/t/headless-api-swashbuckle/1459 "2020-04-29T09:11:04Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [April 29, 2020, 9:48am UTC](https://forum.litium.com/t/headless-api-swashbuckle/1459/6 "2020-04-29T09:48:37Z")

</div>

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.

```cs
    [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.

```cs
    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](https://yourdomain/Litium/swagger) and your defined collection will be visible in the dropdown to the right in top-bar.

---

_[View the full topic](https://forum.litium.com/t/headless-api-swashbuckle/1459)._
