{"action":"created","issue":{"url":"https://api.github.com/repos/skyscreamer/yoga/issues/247","labels_url":"https://api.github.com/repos/skyscreamer/yoga/issues/247/labels{/name}","comments_url":"https://api.github.com/repos/skyscreamer/yoga/issues/247/comments","events_url":"https://api.github.com/repos/skyscreamer/yoga/issues/247/events","html_url":"https://github.com/skyscreamer/yoga/pull/247","id":73364191,"number":247,"title":"Json aliases feature","user":{"login":"manland","id":1492516,"avatar_url":"https://avatars.githubusercontent.com/u/1492516?v=3","gravatar_id":"","url":"https://api.github.com/users/manland","html_url":"https://github.com/manland","followers_url":"https://api.github.com/users/manland/followers","following_url":"https://api.github.com/users/manland/following{/other_user}","gists_url":"https://api.github.com/users/manland/gists{/gist_id}","starred_url":"https://api.github.com/users/manland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manland/subscriptions","organizations_url":"https://api.github.com/users/manland/orgs","repos_url":"https://api.github.com/users/manland/repos","events_url":"https://api.github.com/users/manland/events{/privacy}","received_events_url":"https://api.github.com/users/manland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-05T16:38:16Z","updated_at":"2015-05-14T14:16:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/skyscreamer/yoga/pulls/247","html_url":"https://github.com/skyscreamer/yoga/pull/247","diff_url":"https://github.com/skyscreamer/yoga/pull/247.diff","patch_url":"https://github.com/skyscreamer/yoga/pull/247.patch"},"body":"This pull-request wants to simplify the definitions of aliases.\r\n\r\nHere at [ITK](http://www.itkweb.com/) we use intensively aliases, with time our aliases.properties grownth exponentially. Lots of patterns are similare but with little changes.\r\n\r\nSo we have implemented a json parser, and we have added variable feature.\r\n\r\nSpecifications :\r\n\r\n * the `yoga_aliases` directory in `ressources` directory contains the definitions in multiple files ending by json\r\n * a file can have multiple aliases and/or multiple variables\r\n * a file contains a single json object\r\n * the property of this object must have its name starts by `$` for aliase and `@` for variable\r\n * the value of each property is an array\r\n * each array can contain string for local value, or object for child value\r\n\r\nExamples (from tests) :\r\n\r\nfrom\r\n\r\n```java\r\n$child=test,child(value)\r\n```\r\n\r\nto\r\n\r\n```json\r\n{\r\n  \"$child\": [\r\n    \"test\",\r\n    {\r\n      \"child\": [\"value\"]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nOr from\r\n\r\n```java\r\n$children=test,child(value,value2),child2(value3,child3(*))\r\n```\r\n\r\nto\r\n\r\n```json\r\n{\r\n  \"$children\": [\r\n    \"test\",\r\n    {\r\n      \"child\" : [\r\n        \"value\", \r\n        \"value2\"\r\n      ]\r\n    },\r\n    {\r\n      \"child2\": [\r\n        \"value3\", \r\n        {\r\n          \"child3\": [\"*\"]\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nAnd with variables :\r\n\r\n```json\r\n{\r\n  \"@variable\": [\r\n    \"test\", \r\n    \"test2\"\r\n  ],\r\n  \"$variable\": [\r\n    \"testvar\",\r\n    {\r\n      \"childvar\": [\r\n        \"child\",\r\n        \"@variable\"\r\n      ]\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nCould be represented as :\r\n\r\n```java\r\n$variable=testvar,childvar(child,test,test2)\r\n```\r\n\r\nMore complex variables can be used.\r\n\r\n**The JSON files must be in `yoga_aliases` directory in the ressources directory.**\r\n\r\nIt can contain all files you want, the name of file is not used, but it needs to finish by .json.\r\n\r\nWe use a file, for a view in our application, and each file contains all requests aliases for this view.\r\n\r\nA variable can be defined in one file and used in an other one. And a file can contain only aliases or only variables, it's as you want.\r\n\r\nTo resume :\r\n\r\n * src/main/ressources/yoga_aliases\r\n   * view1.json \r\n     * alias1\r\n       * childName\r\n       * use variable2\r\n     * alias2\r\n       * use variable1\r\n   * mainVariables.json\r\n     * definition of variable1\r\n   * view2.json\r\n     * definition of variable2"},"comment":{"url":"https://api.github.com/repos/skyscreamer/yoga/issues/comments/102048724","html_url":"https://github.com/skyscreamer/yoga/pull/247#issuecomment-102048724","issue_url":"https://api.github.com/repos/skyscreamer/yoga/issues/247","id":102048724,"user":{"login":"studiodev","id":872095,"avatar_url":"https://avatars.githubusercontent.com/u/872095?v=3","gravatar_id":"","url":"https://api.github.com/users/studiodev","html_url":"https://github.com/studiodev","followers_url":"https://api.github.com/users/studiodev/followers","following_url":"https://api.github.com/users/studiodev/following{/other_user}","gists_url":"https://api.github.com/users/studiodev/gists{/gist_id}","starred_url":"https://api.github.com/users/studiodev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/studiodev/subscriptions","organizations_url":"https://api.github.com/users/studiodev/orgs","repos_url":"https://api.github.com/users/studiodev/repos","events_url":"https://api.github.com/users/studiodev/events{/privacy}","received_events_url":"https://api.github.com/users/studiodev/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T14:16:48Z","updated_at":"2015-05-14T14:16:48Z","body":"+1, very interesting feature!"}}