我不知何故必须使用addtionalProperties生成一个swagger doc,因为不允许其他属性。例如,这就是我想要的:
"TestDTO" : {
"type" : "object",
"additionalProperties":false
"properties" : {
"property1" : {
"description" : "This is a test object.",
"$ref" : "#/definitions/TestDTO"
},
"perperty2" : {
"type" : "string",
"description" : "this is a property."
}
}
},
但是setAdditionalProperties只接受一个属性,如何用布尔值设置它?
public void setAdditionalProperties(Property additionalProperties) {
type(OBJECT);
this.additionalProperties = additionalProperties;
}
答案 0 :(得分:1)
在此处查看详情: https://groups.google.com/forum/#!topic/swagger-swaggersocket/1J5KznDibzA