{"action":"created","issue":{"url":"https://api.github.com/repos/springfox/springfox/issues/749","repository_url":"https://api.github.com/repos/springfox/springfox","labels_url":"https://api.github.com/repos/springfox/springfox/issues/749/labels{/name}","comments_url":"https://api.github.com/repos/springfox/springfox/issues/749/comments","events_url":"https://api.github.com/repos/springfox/springfox/issues/749/events","html_url":"https://github.com/springfox/springfox/issues/749","id":79103307,"number":749,"title":"How to set default value and read-only properties?","user":{"login":"opallios","id":12520471,"avatar_url":"https://avatars.githubusercontent.com/u/12520471?v=3","gravatar_id":"","url":"https://api.github.com/users/opallios","html_url":"https://github.com/opallios","followers_url":"https://api.github.com/users/opallios/followers","following_url":"https://api.github.com/users/opallios/following{/other_user}","gists_url":"https://api.github.com/users/opallios/gists{/gist_id}","starred_url":"https://api.github.com/users/opallios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opallios/subscriptions","organizations_url":"https://api.github.com/users/opallios/orgs","repos_url":"https://api.github.com/users/opallios/repos","events_url":"https://api.github.com/users/opallios/events{/privacy}","received_events_url":"https://api.github.com/users/opallios/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/springfox/springfox/labels/feature","name":"feature","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/springfox/springfox/milestones/27","html_url":"https://github.com/springfox/springfox/milestones/2.0.1","labels_url":"https://api.github.com/repos/springfox/springfox/milestones/27/labels","id":1087558,"number":27,"title":"2.0.1","description":"Patch to fix minor issues","creator":{"login":"dilipkrish","id":73257,"avatar_url":"https://avatars.githubusercontent.com/u/73257?v=3","gravatar_id":"","url":"https://api.github.com/users/dilipkrish","html_url":"https://github.com/dilipkrish","followers_url":"https://api.github.com/users/dilipkrish/followers","following_url":"https://api.github.com/users/dilipkrish/following{/other_user}","gists_url":"https://api.github.com/users/dilipkrish/gists{/gist_id}","starred_url":"https://api.github.com/users/dilipkrish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilipkrish/subscriptions","organizations_url":"https://api.github.com/users/dilipkrish/orgs","repos_url":"https://api.github.com/users/dilipkrish/repos","events_url":"https://api.github.com/users/dilipkrish/events{/privacy}","received_events_url":"https://api.github.com/users/dilipkrish/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":20,"state":"closed","created_at":"2015-04-28T14:14:58Z","updated_at":"2015-06-05T04:07:58Z","due_on":null,"closed_at":"2015-06-03T03:47:28Z"},"comments":6,"created_at":"2015-05-21T18:05:24Z","updated_at":"2016-10-06T11:15:26Z","closed_at":"2015-06-05T03:41:21Z","body":"I'm using the latest Spring fox build, 2.0. It's working out great except two main issues,\r\n\r\n1) I'm not able to set a field as read-only. Here is what I've tried,\r\n   a)  JSON way - set ignore (@JsonIgnore) for the field (and setter) and use @JsonProperty in the getter.\r\n    b) Using hidden annotation - I went through the https://github.com/springfox/springfox/issues/554 and enabled readOnly in the ApiModelProperty.\r\n\r\n        @OneToOne\r\n\t@JoinColumn(name = \"search_id\")\r\n\t@JsonIgnore\r\n\t@ApiModelProperty(value = \"xxx\", readOnly = true)\r\n\tprivate Search lastSearch;\r\n\r\n        @JsonProperty\t\r\n\tpublic Search getLastSearch() {\r\n\t\treturn lastSearch;\r\n\t}\r\n\r\n\t@JsonIgnore\r\n\tpublic void setLastSearch(Search lastSearch) {\r\n\t\tthis.lastSearch = lastSearch;\r\n\t}\r\n\r\n, where Search is a referenced object, which can't be set by use, but used only to show results.\r\n\r\nWhat am I missing?\r\n\r\n2) I'm not sure how do I set default value for a field. I want to show the default value for all my optional fields.\r\n"},"comment":{"url":"https://api.github.com/repos/springfox/springfox/issues/comments/251933838","html_url":"https://github.com/springfox/springfox/issues/749#issuecomment-251933838","issue_url":"https://api.github.com/repos/springfox/springfox/issues/749","id":251933838,"user":{"login":"javi-more-garc","id":2869838,"avatar_url":"https://avatars.githubusercontent.com/u/2869838?v=3","gravatar_id":"","url":"https://api.github.com/users/javi-more-garc","html_url":"https://github.com/javi-more-garc","followers_url":"https://api.github.com/users/javi-more-garc/followers","following_url":"https://api.github.com/users/javi-more-garc/following{/other_user}","gists_url":"https://api.github.com/users/javi-more-garc/gists{/gist_id}","starred_url":"https://api.github.com/users/javi-more-garc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javi-more-garc/subscriptions","organizations_url":"https://api.github.com/users/javi-more-garc/orgs","repos_url":"https://api.github.com/users/javi-more-garc/repos","events_url":"https://api.github.com/users/javi-more-garc/events{/privacy}","received_events_url":"https://api.github.com/users/javi-more-garc/received_events","type":"User","site_admin":false},"created_at":"2016-10-06T11:15:26Z","updated_at":"2016-10-06T11:15:26Z","body":"Hello,\r\n\r\nis there ay workaround to get the read-only stuff working? Other than creating different classes...\r\n\r\nThanks"}}
{"actor":{"display_login":"javi-more-garc"}}