{"action":"created","issue":{"url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1438","repository_url":"https://api.github.com/repos/go-swagger/go-swagger","labels_url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1438/labels{/name}","comments_url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1438/comments","events_url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1438/events","html_url":"https://github.com/go-swagger/go-swagger/pull/1438","id":302075843,"number":1438,"title":"Fixes #1437 [format validation in simple schemas]","user":{"login":"fredbi","id":14262513,"avatar_url":"https://avatars1.githubusercontent.com/u/14262513?v=4","gravatar_id":"","url":"https://api.github.com/users/fredbi","html_url":"https://github.com/fredbi","followers_url":"https://api.github.com/users/fredbi/followers","following_url":"https://api.github.com/users/fredbi/following{/other_user}","gists_url":"https://api.github.com/users/fredbi/gists{/gist_id}","starred_url":"https://api.github.com/users/fredbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredbi/subscriptions","organizations_url":"https://api.github.com/users/fredbi/orgs","repos_url":"https://api.github.com/users/fredbi/repos","events_url":"https://api.github.com/users/fredbi/events{/privacy}","received_events_url":"https://api.github.com/users/fredbi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-04T10:50:50Z","updated_at":"2018-03-05T17:45:06Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/go-swagger/go-swagger/pulls/1438","html_url":"https://github.com/go-swagger/go-swagger/pull/1438","diff_url":"https://github.com/go-swagger/go-swagger/pull/1438.diff","patch_url":"https://github.com/go-swagger/go-swagger/pull/1438.patch"},"body":"- fixes #1437 \r\n- fixes #1191"},"comment":{"url":"https://api.github.com/repos/go-swagger/go-swagger/issues/comments/370502375","html_url":"https://github.com/go-swagger/go-swagger/pull/1438#issuecomment-370502375","issue_url":"https://api.github.com/repos/go-swagger/go-swagger/issues/1438","id":370502375,"user":{"login":"fredbi","id":14262513,"avatar_url":"https://avatars1.githubusercontent.com/u/14262513?v=4","gravatar_id":"","url":"https://api.github.com/users/fredbi","html_url":"https://github.com/fredbi","followers_url":"https://api.github.com/users/fredbi/followers","following_url":"https://api.github.com/users/fredbi/following{/other_user}","gists_url":"https://api.github.com/users/fredbi/gists{/gist_id}","starred_url":"https://api.github.com/users/fredbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredbi/subscriptions","organizations_url":"https://api.github.com/users/fredbi/orgs","repos_url":"https://api.github.com/users/fredbi/repos","events_url":"https://api.github.com/users/fredbi/events{/privacy}","received_events_url":"https://api.github.com/users/fredbi/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T17:45:06Z","updated_at":"2018-03-05T17:45:06Z","author_association":"CONTRIBUTOR","body":"So I removed these entries from the map to avoid this kind of wrong generation:\r\n```\r\n// Code generated by go-swagger; DO NOT EDIT.\r\n\r\npackage models\r\n\r\n// This file was generated by the swagger tool.\r\n// Editing this file might prove futile when you re-run the swagger generate command\r\n\r\nimport (\r\n\t\"io\"\r\n\r\n\tstrfmt \"github.com/go-openapi/strfmt\"\r\n\r\n\t\"github.com/go-openapi/errors\"\r\n\t\"github.com/go-openapi/swag\"\r\n\t\"github.com/go-openapi/validate\"\r\n)\r\n\r\n// AnObjectOfInterfaces an object of interfaces\r\n// swagger:model anObjectOfInterfaces\r\ntype AnObjectOfInterfaces struct {\r\n\r\n\t// a reader\r\n\tAReader io.ReadCloser `json:\"aReader,omitempty\"`\r\n}\r\n\r\n// Validate validates this an object of interfaces\r\nfunc (m *AnObjectOfInterfaces) Validate(formats strfmt.Registry) error {\r\n\tvar res []error\r\n\r\n\tif err := m.validateAReader(formats); err != nil {\r\n\t\t// prop\r\n\t\tres = append(res, err)\r\n\t}\r\n\r\n\tif len(res) > 0 {\r\n\t\treturn errors.CompositeValidationError(res...)\r\n\t}\r\n\treturn nil\r\n}\r\n\r\nfunc (m *AnObjectOfInterfaces) validateAReader(formats strfmt.Registry) error {\r\n\r\n\tif swag.IsZero(m.AReader) { // not required\r\n\t\treturn nil\r\n\t}\r\n\r\n\tif err := validate.FormatOf(\"aReader\", \"body\", \"binary\", m.AReader.String(), formats); err != nil {\r\n\t\treturn err\r\n\t}\r\n\r\n\treturn nil\r\n}\r\n\r\n// MarshalBinary interface implementation\r\nfunc (m *AnObjectOfInterfaces) MarshalBinary() ([]byte, error) {\r\n\tif m == nil {\r\n\t\treturn nil, nil\r\n\t}\r\n\treturn swag.WriteJSON(m)\r\n}\r\n\r\n// UnmarshalBinary interface implementation\r\nfunc (m *AnObjectOfInterfaces) UnmarshalBinary(b []byte) error {\r\n\tvar res AnObjectOfInterfaces\r\n\tif err := swag.ReadJSON(b, &res); err != nil {\r\n\t\treturn err\r\n\t}\r\n\t*m = res\r\n\treturn nil\r\n}\r\n\r\n```"}}
{"actor":{"display_login":"fredbi"}}