Do you have some warnings when compiling on different versions?
From the Docs:
“Note: Headless API Addon may use a different version of Litium and other package references than your solution. In which case fix any warnings in the build that shows incompatibility of Litium dlls you have in your project vs Litium version used by the headless api addon. You may add binding redirects (recomended) or choose to upgrade/downgrade headless API addon references)”
Maybe you need binding-redirect in web.config?
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.