{"action":"created","issue":{"url":"https://api.github.com/repos/FIXTradingCommunity/fix-simple-binary-encoding/issues/31","repository_url":"https://api.github.com/repos/FIXTradingCommunity/fix-simple-binary-encoding","labels_url":"https://api.github.com/repos/FIXTradingCommunity/fix-simple-binary-encoding/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/FIXTradingCommunity/fix-simple-binary-encoding/issues/31/comments","events_url":"https://api.github.com/repos/FIXTradingCommunity/fix-simple-binary-encoding/issues/31/events","html_url":"https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/issues/31","id":178864593,"number":31,"title":"handling of presence=\"optional\" field when the type has presence=\"mandatory\"","user":{"login":"2pl","id":529724,"avatar_url":"https://avatars.githubusercontent.com/u/529724?v=3","gravatar_id":"","url":"https://api.github.com/users/2pl","html_url":"https://github.com/2pl","followers_url":"https://api.github.com/users/2pl/followers","following_url":"https://api.github.com/users/2pl/following{/other_user}","gists_url":"https://api.github.com/users/2pl/gists{/gist_id}","starred_url":"https://api.github.com/users/2pl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2pl/subscriptions","organizations_url":"https://api.github.com/users/2pl/orgs","repos_url":"https://api.github.com/users/2pl/repos","events_url":"https://api.github.com/users/2pl/events{/privacy}","received_events_url":"https://api.github.com/users/2pl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-23T12:30:45Z","updated_at":"2016-09-26T10:26:38Z","closed_at":null,"body":"Hi,\r\n\r\nThe **presence** attribute is allowed at the field level and the type level\r\n- am I right assuming the *field* presence attribute takes precedence over the type presence attribute?\r\n- given **nullValue** can only be specified at the *type* level, is it correct to define a type with presence=\"required\" nullValue=XXX like in exemple below ? \r\n````\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<sbe:messageSchema xmlns:sbe=\"http://fixprotocol.io/2016/sbe\"\r\n                   package=\"sbe.test\"\r\n                   id=\"1\" version=\"1\" semanticVersion=\"0.1\"\r\n                   description=\"Example schema\"\r\n                   byteOrder=\"littleEndian\">\r\n    <types>\r\n        <type name=\"VehicleCode\" primitiveType=\"char\" length=\"6\" characterEncoding=\"ASCII\"/>\r\n        <type name=\"SeatCount\" primitiveType=\"uint8\" presence=\"required\" nullValue=\"255\"/>\r\n    </types>\r\n    <sbe:message name=\"Car\" id=\"1\" description=\"Description of a basic Car\">\r\n        <field name=\"vehicleCode\" id=\"1\" type=\"VehicleCode\"/>\r\n        <field name=\"seats\" id=\"2\" type=\"SeatCount\" presence=\"optional\"/>\r\n    </sbe:message>\r\n    <sbe:message name=\"SuperCar\" id=\"2\" description=\"Description of a super Car\">\r\n        <field name=\"vehicleCode\" id=\"1\" type=\"VehicleCode\"/>\r\n        <field name=\"seats\" id=\"2\" type=\"SeatCount\"/>\r\n    </sbe:message>\r\n</sbe:messageSchema>\r\n```` \r\n\r\n- If the above is not allowed, then I guess the other way round would work:\r\n\r\n````\r\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n<sbe:messageSchema xmlns:sbe=\"http://fixprotocol.io/2016/sbe\"\r\n                   package=\"sbe.test\"\r\n                   id=\"1\" version=\"1\" semanticVersion=\"0.1\"\r\n                   description=\"Example schema\"\r\n                   byteOrder=\"littleEndian\">\r\n    <types>\r\n        <type name=\"VehicleCode\" primitiveType=\"char\" length=\"6\" characterEncoding=\"ASCII\"/>\r\n        <type name=\"SeatCount\" primitiveType=\"uint8\" presence=\"optional\" nullValue=\"255\"/>\r\n    </types>\r\n    <sbe:message name=\"Car\" id=\"1\" description=\"Description of a basic Car\">\r\n        <field name=\"vehicleCode\" id=\"1\" type=\"VehicleCode\"/>\r\n        <field name=\"seats\" id=\"2\" type=\"SeatCount\" />\r\n    </sbe:message>\r\n    <sbe:message name=\"SuperCar\" id=\"2\" description=\"Description of a super Car\">\r\n        <field name=\"vehicleCode\" id=\"1\" type=\"VehicleCode\"/>\r\n        <field name=\"seats\" id=\"2\" type=\"SeatCount\" presence=\"required\"/>\r\n    </sbe:message>\r\n</sbe:messageSchema>\r\n```` \r\n- Or should we just be defining different types for optional and required ? I noticed CME is doing that.\r\n\r\nThank you. \r\n"},"comment":{"url":"https://api.github.com/repos/FIXTradingCommunity/fix-simple-binary-encoding/issues/comments/249534197","html_url":"https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/issues/31#issuecomment-249534197","issue_url":"https://api.github.com/repos/FIXTradingCommunity/fix-simple-binary-encoding/issues/31","id":249534197,"user":{"login":"2pl","id":529724,"avatar_url":"https://avatars.githubusercontent.com/u/529724?v=3","gravatar_id":"","url":"https://api.github.com/users/2pl","html_url":"https://github.com/2pl","followers_url":"https://api.github.com/users/2pl/followers","following_url":"https://api.github.com/users/2pl/following{/other_user}","gists_url":"https://api.github.com/users/2pl/gists{/gist_id}","starred_url":"https://api.github.com/users/2pl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2pl/subscriptions","organizations_url":"https://api.github.com/users/2pl/orgs","repos_url":"https://api.github.com/users/2pl/repos","events_url":"https://api.github.com/users/2pl/events{/privacy}","received_events_url":"https://api.github.com/users/2pl/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T10:26:38Z","updated_at":"2016-09-26T10:26:38Z","body":"@donmendelson can you confirm one should be able to define a type with a custom nullValue, without explicitly setting the type as optional:\r\n````\r\n<type name=\"zeroIsNullInt32\" description=\"int32 with zero as nullValue\" primitiveType=\"int32\" nullValue=\"0\"/>\r\n````\r\n\r\n"}}
{"actor":{"display_login":"2pl"}}