Skip to content

Commit c058c80

Browse files
committed
Update documentation
1 parent ed4a2a6 commit c058c80

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

docs/usage/openapi.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# OpenAPI
22

3-
JsonApiDotNetCore provides an extension package that enables you to produce an [OpenAPI specification](https://swagger.io/specification/) for your JSON:API endpoints. This can be used to generate a [documentation website](https://swagger.io/tools/swagger-ui/) or to generate [client libraries](https://openapi-generator.tech/docs/generators/) in various languages. The package provides an integration with [Swashbuckle](https://github.com/domaindrivendev/Swashbuckle.AspNetCore).
3+
JsonApiDotNetCore provides an extension package that enables you to produce an [OpenAPI specification](https://swagger.io/specification/) for your JSON:API endpoints.
4+
This can be used to generate a [documentation website](https://swagger.io/tools/swagger-ui/) or to generate [client libraries](https://openapi-generator.tech/docs/generators/) in various languages.
5+
The package provides an integration with [Swashbuckle](https://github.com/domaindrivendev/Swashbuckle.AspNetCore).
46

57

68
## Getting started
@@ -35,10 +37,29 @@ By default, the OpenAPI specification will be available at `http://localhost:<po
3537
3638
## Documentation
3739
38-
Swashbuckle also ships with [SwaggerUI](https://swagger.io/tools/swagger-ui/), which enables to visualize and interact with the API endpoints through a web page. This can be enabled by installing the `Swashbuckle.AspNetCore.SwaggerUI` NuGet package and adding the following to your `Program.cs` file:
40+
### SwaggerUI
41+
42+
Swashbuckle also ships with [SwaggerUI](https://swagger.io/tools/swagger-ui/), which enables to visualize and interact with the API endpoints through a web page.
43+
This can be enabled by installing the `Swashbuckle.AspNetCore.SwaggerUI` NuGet package and adding the following to your `Program.cs` file:
3944
4045
```c#
4146
app.UseSwaggerUI();
4247
```
4348

4449
By default, SwaggerUI will be available at `http://localhost:<port>/swagger`.
50+
51+
### Triple-slash comments
52+
53+
Documentation for JSON:API endpoints is provided out of the box, which shows in SwaggerUI and through IDE IntelliSense in auto-generated clients.
54+
To also get documentation for your resource classes and their properties, add the following to your project file.
55+
The `NoWarn` line is optional, which suppresses build warnings for undocumented types and members.
56+
57+
```xml
58+
<PropertyGroup>
59+
<GenerateDocumentationFile>True</GenerateDocumentationFile>
60+
<NoWarn>$(NoWarn);1591</NoWarn>
61+
</PropertyGroup>
62+
```
63+
64+
You can combine this with the documentation that Swagger itself supports, by enabling it as described [here](https://github.com/domaindrivendev/Swashbuckle.AspNetCore#include-descriptions-from-xml-comments).
65+
This adds documentation for additional types, such as triple-slash comments on enums used in your resource models.

0 commit comments

Comments
 (0)