#Set additionalProperties to false by default in OpenAPI

1 messages · Page 1 of 1 (latest)

mossy stag
#

Hi,

I am generating clients for .NET / Java and so on from my OpenAPI specification that is generated by NestJS. The default value for additionalProperties is true according to OpenAPI and therefore all my generated classes have extra properties to catch this. Is there an option to turn this off or to annotate a class with something like

@ApiModel({ additionalProperties: false })
export class ErrorDto {

Btw: I cannot find a tag or channel for openapi

spring canyon
#

you can use #1025200803239166012 for swagger stuff 🙂

rustic wigeon
#

#1025200803239166012 -> Swagger

No option that I know of, but let me check some interfaces

#

Looks like you can pass the option as a part of the schema property of the @ApiBody() options. You could then make an extension of the decorator so that it's there by default

mossy stag