Swagger: Add hidden option in @ApiModelProperty

Created on 19 Jun 2019  ·  7Comments  ·  Source: nestjs/swagger

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

What is the motivation / use case for changing the behavior?


Swagger support to hide a property of model via hidden option, .

Could you add it?

Most helpful comment

Can't you just... Not add the decorator?

All 7 comments

Can't you just... Not add the decorator?

What if I want to extend a class from a third party library and I don't want some property in superclass.

A similar issue raised in swagger core repo: https://github.com/swagger-api/swagger-core/issues/730

如果属性是来自父类的自定义对象,@ApiModelProperty 中的hidden属性失效~

Can't you just... Not add the decorator?

With nestjs/swagger v4 plugin enabled, all properties are automatically added to swagger. So this feature will be really nice to have.

@MardariG @ApiHideProperty() (see docs)

@kamilmysliwiec @ApiHideProperty() causes weird behaviour, and seems to make the field read only.

See:
image
image
(I am also experiencing this)

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mogusbi picture mogusbi  ·  3Comments

ph55 picture ph55  ·  3Comments

itslenny picture itslenny  ·  3Comments

vh13294 picture vh13294  ·  4Comments

ericzon picture ericzon  ·  4Comments