Skip to content

Commit 021561e

Browse files
Merge branch 'jokester-patch-1'
2 parents f53f384 + df54e25 commit 021561e

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

content/openapi/introduction.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ async function bootstrap() {
4242
bootstrap();
4343
```
4444

45+
> info **Hint** `document` (returned by the `SwaggerModule#createDocument()` method) 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.
46+
4547
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.
4648

4749
Once we create a document, we can call the `setup()` method. It accepts:

content/techniques/mongo.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ In case there are multiple owners, your property configuration should look as fo
8787
```typescript
8888
@Prop({ type: [Types.ObjectId], ref: Owner.name })
8989
owner: Owner[];
90+
```
91+
9092
Finally, the **raw** schema definition can also be passed to the decorator. This is useful when, for example, a property represents a nested object which is not defined as a class. For this, use the `raw()` function from the `@nestjs/mongoose` package, as follows:
9193

9294
```typescript

package-lock.json

Lines changed: 34 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)