@ApiProperty
with type: 'object'
does not compile in some cases #3163
Closed
Description
Did you read the migration guide?
- I have read the whole migration guide
Is there an existing issue that is already proposing this?
- I have searched the existing issues
Potential Commit/PR that introduced the regression
Versions
7.4.2 -> 8.0.0
Describe the regression
SchemaObjectMetadata
, which is used by the @ApiProperty
decorator, has become more restrictive. Previously, type
could be any string
(amongst others). Now, if the type
is 'object'
, it must also provide properties
, and required
applies to... the properties of the object itself?
I would assume the minimum reproduction code is a valid JSONSchema. How do I express it using the @ApiProperty
decorator?
Minimum reproduction code
@ApiProperty({
required: true,
description: 'Some description.',
type: 'object',
additionalProperties: { type: 'boolean' },
})
Expected behavior
The minimum reproduction code compiles.
Other
No response