{"action":"opened","issue":{"url":"https://api.github.com/repos/metosin/schema-viz/issues/6","repository_url":"https://api.github.com/repos/metosin/schema-viz","labels_url":"https://api.github.com/repos/metosin/schema-viz/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/metosin/schema-viz/issues/6/comments","events_url":"https://api.github.com/repos/metosin/schema-viz/issues/6/events","html_url":"https://github.com/metosin/schema-viz/issues/6","id":143503661,"number":6,"title":"Show cardinality for relations","user":{"login":"Reefersleep","id":4503878,"avatar_url":"https://avatars.githubusercontent.com/u/4503878?v=3","gravatar_id":"","url":"https://api.github.com/users/Reefersleep","html_url":"https://github.com/Reefersleep","followers_url":"https://api.github.com/users/Reefersleep/followers","following_url":"https://api.github.com/users/Reefersleep/following{/other_user}","gists_url":"https://api.github.com/users/Reefersleep/gists{/gist_id}","starred_url":"https://api.github.com/users/Reefersleep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reefersleep/subscriptions","organizations_url":"https://api.github.com/users/Reefersleep/orgs","repos_url":"https://api.github.com/users/Reefersleep/repos","events_url":"https://api.github.com/users/Reefersleep/events{/privacy}","received_events_url":"https://api.github.com/users/Reefersleep/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-25T13:54:16Z","updated_at":"2016-03-25T13:54:16Z","closed_at":null,"body":"Currently, all relations are showed in the same way - a line going from the containing element to the contained element, with a black diamond on the contained end. For example, the relations in these two examples look identical, even though there is a difference in the cardinality:\r\n\r\n```\r\n;;Example 1: Zero to many\r\n(s/defschema State\r\n  {:name s/Str})\r\n\r\n(s/defschema Country\r\n  {:name s/Str\r\n   :states [State]})\r\n```\r\n```\r\n;;Example 2: Exactly one\r\n(s/defschema State\r\n  {:name s/Str})\r\n\r\n(s/defschema Citizen\r\n  {:first-name s/Str\r\n   :last-name s/Str\r\n   :home-state State})\r\n```\r\n```\r\n;;Example 3: Optional\r\n(s/defschema State\r\n  {:name s/Str})\r\n\r\n(s/defschema Burger\r\n  {:name s/Str\r\n   (s/optional-key :origin-state) State})\r\n```\r\nThe difference between these relations could be shown as;\r\n* Example 1: A ``*`` on the end of the line going to the contained element\r\n* Example 2: A ``1`` on the end of the line going to the contained element\r\n* Example 2: A ``0..1`` on the end of the line going to the contained element"}}