Nestjs/swagger how to write nested properties with arrays?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2023
09:54 AM
01-27-2023
09:54 AM
Nestjs/swagger how to write nested properties with arrays?
How to write a Class with this? :
movements:
type: array
items:
type: object
properties:
merchant_name:
description: Merchant's name
type: string
example: MERSARQRT Mi&CO
merchant_code:
type: string
example: MER003
amount:
example: 100.01
type: number
format: double
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2023
05:26 AM
01-30-2023
05:26 AM
Hi @mhosan ,
Not sure I understand, do you mean to have an object that contains the property `movements`and the schema you've already described?
If so, you've got most of it, see: https://app.swaggerhub.com/apis/SwaggerPMTests/nested-array-item/1.0.0
And see https://swagger.io/docs/specification/data-models/ for more info.
