{"action":"created","issue":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/3339","repository_url":"https://api.github.com/repos/mesosphere/marathon","labels_url":"https://api.github.com/repos/mesosphere/marathon/issues/3339/labels{/name}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/3339/comments","events_url":"https://api.github.com/repos/mesosphere/marathon/issues/3339/events","html_url":"https://github.com/mesosphere/marathon/issues/3339","id":136355927,"number":3339,"title":"Port indices notation in validation errors is not consistent","user":{"login":"gkleiman","id":146374,"avatar_url":"https://avatars.githubusercontent.com/u/146374?v=3","gravatar_id":"","url":"https://api.github.com/users/gkleiman","html_url":"https://github.com/gkleiman","followers_url":"https://api.github.com/users/gkleiman/followers","following_url":"https://api.github.com/users/gkleiman/following{/other_user}","gists_url":"https://api.github.com/users/gkleiman/gists{/gist_id}","starred_url":"https://api.github.com/users/gkleiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkleiman/subscriptions","organizations_url":"https://api.github.com/users/gkleiman/orgs","repos_url":"https://api.github.com/users/gkleiman/repos","events_url":"https://api.github.com/users/gkleiman/events{/privacy}","received_events_url":"https://api.github.com/users/gkleiman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mesosphere/marathon/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mesosphere/marathon/labels/service","name":"service","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"alexanderweber","id":6862750,"avatar_url":"https://avatars.githubusercontent.com/u/6862750?v=3","gravatar_id":"","url":"https://api.github.com/users/alexanderweber","html_url":"https://github.com/alexanderweber","followers_url":"https://api.github.com/users/alexanderweber/followers","following_url":"https://api.github.com/users/alexanderweber/following{/other_user}","gists_url":"https://api.github.com/users/alexanderweber/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanderweber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanderweber/subscriptions","organizations_url":"https://api.github.com/users/alexanderweber/orgs","repos_url":"https://api.github.com/users/alexanderweber/repos","events_url":"https://api.github.com/users/alexanderweber/events{/privacy}","received_events_url":"https://api.github.com/users/alexanderweber/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mesosphere/marathon/milestones/28","html_url":"https://github.com/mesosphere/marathon/milestones/0.16.0","labels_url":"https://api.github.com/repos/mesosphere/marathon/milestones/28/labels","id":1489399,"number":28,"title":"0.16.0","description":"RC-1 will be released on 2016-02-22","creator":{"login":"aquamatthias","id":330485,"avatar_url":"https://avatars.githubusercontent.com/u/330485?v=3","gravatar_id":"","url":"https://api.github.com/users/aquamatthias","html_url":"https://github.com/aquamatthias","followers_url":"https://api.github.com/users/aquamatthias/followers","following_url":"https://api.github.com/users/aquamatthias/following{/other_user}","gists_url":"https://api.github.com/users/aquamatthias/gists{/gist_id}","starred_url":"https://api.github.com/users/aquamatthias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aquamatthias/subscriptions","organizations_url":"https://api.github.com/users/aquamatthias/orgs","repos_url":"https://api.github.com/users/aquamatthias/repos","events_url":"https://api.github.com/users/aquamatthias/events{/privacy}","received_events_url":"https://api.github.com/users/aquamatthias/received_events","type":"User","site_admin":false},"open_issues":52,"closed_issues":71,"state":"open","created_at":"2016-01-07T12:41:04Z","updated_at":"2016-03-03T09:12:54Z","due_on":"2016-03-13T23:00:00Z","closed_at":null},"comments":5,"created_at":"2016-02-25T11:10:36Z","updated_at":"2016-03-03T11:54:05Z","closed_at":null,"body":"- In some cases Marathon will use parentheses to index validation failures, in other cases it will use square brackets.\r\n- Paths sometimes have a leading slash, but they sometimes don't.\r\n- Paths are sometimes separated by slashes, sometimes by periods.\r\n\r\nSome examples:\r\n\r\n```json\r\n{\r\n    \"details\": [\r\n        {\r\n            \"errors\": [\r\n                \"Constraint definition must be an array of strings in format: <key>, <operator>[, value]\"\r\n            ],\r\n            \"path\": \"/constraints(0)\"\r\n        }\r\n    ],\r\n    \"message\": \"Invalid JSON\"\r\n}\r\n```\r\n\r\n```json\r\n{\r\n    \"details\": [\r\n        {\r\n            \"errors\": [\r\n                \"URI has invalid syntax.\"\r\n            ],\r\n            \"path\": \"fetch[0]\"\r\n        }\r\n    ],\r\n    \"message\": \"Object is not valid\"\r\n}\r\n```\r\n\r\n```json\r\n{\r\n    \"details\": [\r\n        {\r\n            \"errors\": [\r\n                \"error.path.missing\"\r\n            ],\r\n            \"path\": \"/fetch(0)/uri\"\r\n        }\r\n    ],\r\n    \"message\": \"Invalid JSON\"\r\n}\r\n```\r\n\r\n```json\r\n{\r\n    \"details\": [\r\n        {\r\n            \"errors\": [\r\n                \"got -1, expected 0 or more\"\r\n            ],\r\n            \"path\": \"portDefinitions[0].port\"\r\n        }\r\n    ],\r\n    \"message\": \"Object is not valid\"\r\n}\r\n```\r\n\r\nThe schema should be consistent. Until v0.15.0 we were always using parentheses, I think we should go back to that.\r\n\r\nTo find the affected validations, look for usages of the `every` validator.\r\n\r\ncc/ @aldipower @alexanderweber "},"comment":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/comments/191724401","html_url":"https://github.com/mesosphere/marathon/issues/3339#issuecomment-191724401","issue_url":"https://api.github.com/repos/mesosphere/marathon/issues/3339","id":191724401,"user":{"login":"alexanderweber","id":6862750,"avatar_url":"https://avatars.githubusercontent.com/u/6862750?v=3","gravatar_id":"","url":"https://api.github.com/users/alexanderweber","html_url":"https://github.com/alexanderweber","followers_url":"https://api.github.com/users/alexanderweber/followers","following_url":"https://api.github.com/users/alexanderweber/following{/other_user}","gists_url":"https://api.github.com/users/alexanderweber/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanderweber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanderweber/subscriptions","organizations_url":"https://api.github.com/users/alexanderweber/orgs","repos_url":"https://api.github.com/users/alexanderweber/repos","events_url":"https://api.github.com/users/alexanderweber/events{/privacy}","received_events_url":"https://api.github.com/users/alexanderweber/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T11:54:05Z","updated_at":"2016-03-03T11:54:05Z","body":"@aldipower regarding your example - the object being validated here is probably a group, being the root object of validation. We decided not to prepend this information as described in #3255. Here the explicit error path would be:\r\n```\r\n/apps(2)/container/volumes(1)\r\n```\r\nThat is why the index information 2 might be used in order to find the affected app in first place, namely being the third application in the group.\r\n\r\n@aquamatthias I am about to change the scheme as following:\r\n\r\n1. replace `[` `]` with `(` `)` respectively\r\n2. replace `.` by `/`\r\n3. prepend `/` at the root of each path. This would also replace `self` with `/` in root-only errors\r\n\r\ncc /@pierlo-upitup point 3 is sort of conflicting with what we agreed on in #3255. Let me know if you have different thoughts on that one."}}