This module allows you to create APIs documentations using Swagger.
1.4.1
Api
This module has no dependencies.
Name | Swagger (OrchardCoreContrib.Apis.Swagger ) |
Description | Enables Swagger for OrchardCore APIs. |
Dependencies |
Name | Swagger (OrchardCoreContrib.Apis.Swagger.UI ) |
Description | Enables Swagger UI for OrchardCore APIs. |
Dependencies | OrchardCoreContrib.Apis.Swagger |
Name | Version |
---|---|
OrchardCoreContrib.Apis.Swagger |
1.5.0 |
OrchardCoreContrib.Apis.Swagger |
1.4.1 |
OrchardCoreContrib.Apis.Swagger |
1.4.0 |
OrchardCoreContrib.Apis.Swagger |
1.3.0 |
OrchardCoreContrib.Apis.Swagger |
1.2.0 |
OrchardCoreContrib.Apis.Swagger |
1.1.0 |
OrchardCoreContrib.Apis.Swagger |
1.0.1 |
OrchardCoreContrib.Apis.Swagger |
1.0.0 |
- Install the
OrchardCoreContrib.Apis.Swagger
NuGet package to your Orchard Core host project. - Go to the admin site
- Select Configuration -> Features menu.
- Enable the
Swagger
feature. - Go to the
{tenant-URL}/swagger/v1.0.0/swagger.json
, you should see all the APIs listed in JSON format.
- Enable the
Swagger UI
feature. - Go to the
{tenant-URL}/swagger/index.html
, you should see all the APIs listed in a pretty styled page.
Adding your APIs is not swagger docs is not a difficult task, simply you need:
- Add
ApiController
. - Annotate the controller with
[Route("api/{module}")]
. - Add your
HttpGet
orHttpPost
methods into your contoller. - Then your APIs should be displayed into the swagger docs.
So, If you tried to enable Lucene
or Queries
modules for instance, their APIs will show up immediately in the swagger docs. That's because every module defined an ApiController
in the same way that mentioned above.
For more information about swagger, please refer to ASP.NET Core web API documentation with Swagger / OpenAPI.