Skip to content

Commit 2b10aad

Browse files
Merge pull request #3277 from jkrmarmol/jkrmarmol
docs: fix typos in openapi swagger
2 parents aded9a3 + a42b19d commit 2b10aad

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

content/openapi/introduction.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async function bootstrap() {
3737
bootstrap();
3838
```
3939

40-
> 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.
40+
> 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.
4141
4242
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).
4343

@@ -286,20 +286,21 @@ export interface SwaggerCustomOptions {
286286
urls?: Record<'url' | 'name', string>[];
287287
}
288288
```
289-
> info **Hint** `ui` and `raw` are independent options. Disabling Swagger UI (`ui: false`) does not disable API definitions (JSON/YAML). Conversely, disabling API definitions (`raw: []`) does not disable the Swagger UI.
289+
290+
> info **Hint** `ui` and `raw` are independent options. Disabling Swagger UI (`ui: false`) does not disable API definitions (JSON/YAML). Conversely, disabling API definitions (`raw: []`) does not disable the Swagger UI.
290291
>
291292
> For example, the following configuration will disable the Swagger UI but still allow access to API definitions:
293+
>
292294
> ```typescript
293-
>const options: SwaggerCustomOptions = {
294-
> ui: false, // Swagger UI is disabled
295-
> raw: ['json'], // JSON API definition is still accessible (YAML is disabled)
296-
>};
297-
>SwaggerModule.setup('api', app, options);
295+
> const options: SwaggerCustomOptions = {
296+
> ui: false, // Swagger UI is disabled
297+
> raw: ['json'], // JSON API definition is still accessible (YAML is disabled)
298+
> };
299+
> SwaggerModule.setup('api', app, options);
298300
> ```
299301
>
300302
> In this case, http://localhost:3000/api-json will still be accessible, but http://localhost:3000/api (Swagger UI) will not.
301303
302-
303304
#### Example
304305
305306
A working example is available [here](https://github.com/nestjs/nest/tree/master/sample/11-swagger).

content/openapi/types-and-parameters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export class CreateCatDto {}
293293

294294
> info **Hint** You only need to use `@ApiExtraModels()` once for a specific model class.
295295

296-
Alternatively, you can pass an options object with the `extraModels` property specified to the `SwaggerModule#createDocument()` method, as follows:
296+
Alternatively, you can pass an options object with the `extraModels` property specified to the `SwaggerModule.createDocument()` method, as follows:
297297

298298
```typescript
299299
const documentFactory = () =>

0 commit comments

Comments
 (0)