Open aturner-tvpage opened 5 years ago
I'm experiencing this, too.
Got around it by creating a filter. Extend AbstractSpecFilter
and override isParamAllowed
so it filters out parameters named password
. Not ideal, but it works.
Not sure if these are connected (in implementation sense), but the similar issue is with the query parameters hidden flag (@ApiParam
) (https://github.com/swagger-api/swagger-play/issues/206). I haven't looked at the code, but my assumption (based on query parameters behavior) is that hidden
is actually respected, but some other logic might be regenerating that property again.
I just discovered that this is a known "issue" documented here: https://github.com/swagger-api/swagger-scala-module#how-to-hide-model-properties
You should be able to use something like this:
import io.swagger.annotations.{ApiModel, ApiModelProperty}
import scala.annotation.meta.{field,getter}
@ApiModel
case class Foo(
@ApiModelProperty(value = "This will not be hidden!", hidden = true)
stillVisible: Int,
@(ApiModelProperty @field @getter)(value = "A hidden property", hidden = true)
actuallyHidden: String
)
It's a bit ugly but it's related to the underlying Java reflection stuff
When generating this model, the hidden parameter doesn't appear to be respected: