Skip to content

Commit a8bc20a

Browse files
docs(): minor tweaks
1 parent 48d5b9d commit a8bc20a

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

content/openapi/introduction.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,25 @@ The `SwaggerModule` automatically reflects all of your endpoints. Note that the
6666

6767
> info **Hint** To generate and download a Swagger JSON file, navigate to `http://localhost:3000/api-json` (`swagger-ui-express`) or `http://localhost:3000/api/json` (`fastify-swagger`) in your browser (assuming that your Swagger documentation is available under `http://localhost:3000/api`).
6868
69-
> warning **Warning** When using `fastify-swagger` and `helmet`, there may be a problem with [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP), to solve this collision, configure the CSP as indicated below:
70-
```ts
71-
app.register(helmet, {
72-
contentSecurityPolicy: {
73-
directives: {
74-
defaultSrc: [`'self'`],
75-
styleSrc: [`'self'`, `'unsafe-inline'`],
76-
imgSrc: [`'self'`, 'data:', 'validator.swagger.io'],
77-
scriptSrc: [`'self'`, `https: 'unsafe-inline'`],
78-
},
79-
},
80-
})
81-
82-
// If you are not going to use CSP at all, you can use this:
83-
app.register(helmet, {
84-
contentSecurityPolicy: false,
85-
})
86-
```
69+
> warning **Warning** When using `fastify-swagger` and `helmet`, there may be a problem with [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP), to solve this collision, configure the CSP as shown below:
70+
>
71+
> ```typescript
72+
> app.register(helmet, {
73+
> contentSecurityPolicy: {
74+
> directives: {
75+
> defaultSrc: [`'self'`],
76+
> styleSrc: [`'self'`, `'unsafe-inline'`],
77+
> imgSrc: [`'self'`, 'data:', 'validator.swagger.io'],
78+
> scriptSrc: [`'self'`, `https: 'unsafe-inline'`],
79+
> },
80+
> },
81+
> });
82+
>
83+
> // If you are not going to use CSP at all, you can use this:
84+
> app.register(helmet, {
85+
> contentSecurityPolicy: false,
86+
> });
87+
> ```
8788
8889
#### Example
8990

0 commit comments

Comments
 (0)