You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Schema "properties" does not implement attribute "readOnly". For example, the following code snippet does not compile...
importcom.wordnik.swagger.annotations._@ApiModel(value ="Account", description ="Represents an user account")
traitAccount {
@ApiModelProperty(value ="The identifier of the account", dataType ="string", readOnly =true, position =1)
defid:Option[String]
...
}
... and always produce the following error message:
[error] /home/j3d/Projects/xxxxxx/modules/common/app/models/api/Account.scala:19: unknown annotation argument name: readOnly
[error] @ApiModelProperty(value = "The identifier of the account", dataType = "string", readOnly = true, position = 1)
Thanks,
j3d
The text was updated successfully, but these errors were encountered:
Jackson currently has limited support for ignoring fields on deserialise only (see link below). Through a combination of JsonIgnore on field and setter and JsonProperty on getter you can get this kind of behaviour but it's more a trick then a feature. Even though this will get you the serialisation behaviour it will obviously not get you the correct swagger Model.
The swagger model converter uses the com.fasterxml.jackson.databind.AnnotationIntrospector to abstract the actual annotations being used (jaxb, Jackson or ModelAPI ). Unless the readOnly concept is added on that API (and then also in the jackson deserialiser), I see no clean way to add it to swagger given the current design.
Schema "properties" does not implement attribute "readOnly". For example, the following code snippet does not compile...
... and always produce the following error message:
Thanks,
j3d
The text was updated successfully, but these errors were encountered: