{"action":"opened","issue":{"url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1510","repository_url":"https://api.github.com/repos/go-swagger/go-swagger","labels_url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1510/labels{/name}","comments_url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1510/comments","events_url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1510/events","html_url":"https://github.com/go-swagger/go-swagger/issues/1510","id":319802053,"number":1510,"title":"Spec generation doesn't honour the \",string\" JSON struct tag","user":{"login":"neilgarb","id":598376,"avatar_url":"https://avatars0.githubusercontent.com/u/598376?v=4","gravatar_id":"","url":"https://api.github.com/users/neilgarb","html_url":"https://github.com/neilgarb","followers_url":"https://api.github.com/users/neilgarb/followers","following_url":"https://api.github.com/users/neilgarb/following{/other_user}","gists_url":"https://api.github.com/users/neilgarb/gists{/gist_id}","starred_url":"https://api.github.com/users/neilgarb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilgarb/subscriptions","organizations_url":"https://api.github.com/users/neilgarb/orgs","repos_url":"https://api.github.com/users/neilgarb/repos","events_url":"https://api.github.com/users/neilgarb/events{/privacy}","received_events_url":"https://api.github.com/users/neilgarb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-03T06:36:01Z","updated_at":"2018-05-03T06:36:01Z","closed_at":null,"author_association":"NONE","body":"## Problem statement\r\n\r\nI have a field in a response struct which specifies that it's encoded as a string when marshalled to JSON.\r\n\r\n```go\r\n// swagger:model\r\ntype Foo struct {\r\n    Bar int64 `json:\"bar,string\"`\r\n}\r\n```\r\n\r\nWhen I generate the spec for Foo, the type of Bar is integer, when it should in fact be string.\r\n\r\n## Proposed solution\r\n\r\nIn parseJSONTag(), also return a boolean indicating that the field has the \",string\" directive. When the field's type is determined, override it with type:string and format:<original type> if the directive is present.\r\n\r\n## Swagger specification\r\n\r\n2.0\r\n\r\n## Steps to reproduce\r\n\r\nN/A\r\n\r\n## Environment\r\nswagger version: 2.0\r\ngo version: 1.10.1\r\nOS:  macOS 10.12.6\r\n"}}
{"actor":{"display_login":"neilgarb"}}