From 13da8e003ddb2d81a704f087a1446172f336eaa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20My=C5=9Bliwiec?= Date: Thu, 17 Oct 2024 12:51:01 +0200 Subject: [PATCH] chore: improve wording --- content/openapi/introduction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/openapi/introduction.md b/content/openapi/introduction.md index 024550e0f1..dce1500241 100644 --- a/content/openapi/introduction.md +++ b/content/openapi/introduction.md @@ -37,7 +37,7 @@ async function bootstrap() { bootstrap(); ``` -> info **Hint** The factory around `SwaggerModule#createDocument()` is only used to create the document when you actually request Swagger, saving some initialization time and is a serializable object conforming to [OpenAPI Document](https://swagger.io/specification/#openapi-document). Instead of hosting it via HTTP, you could also save it as a JSON/YAML file, and consume it in different ways. +> info **Hint** The factory method `SwaggerModule#createDocument()` is used specifically to generate the Swagger document when you request it. This approach helps save some initialization time, and the resulting document is a serializable object that conforms to the [OpenAPI Document](https://swagger.io/specification/#openapi-document) specification. Instead of serving the document over HTTP, you can also save it as a JSON or YAML file and use it in various ways. The `DocumentBuilder` helps to structure a base document that conforms to the OpenAPI Specification. It provides several methods that allow setting such properties as title, description, version, etc. In order to create a full document (with all HTTP routes defined) we use the `createDocument()` method of the `SwaggerModule` class. This method takes two arguments, an application instance and a Swagger options object. Alternatively, we can provide a third argument, which should be of type `SwaggerDocumentOptions`. More on this in the [Document options section](/openapi/introduction#document-options).