{"action":"opened","issue":{"url":"https://api.github.com/repos/mulesoft/raml-for-jax-rs/issues/86","labels_url":"https://api.github.com/repos/mulesoft/raml-for-jax-rs/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/mulesoft/raml-for-jax-rs/issues/86/comments","events_url":"https://api.github.com/repos/mulesoft/raml-for-jax-rs/issues/86/events","html_url":"https://github.com/mulesoft/raml-for-jax-rs/issues/86","id":77464519,"number":86,"title":"XML example generated not supporting hierarchy (Parent child element relation)","user":{"login":"arubalac","id":10407640,"avatar_url":"https://avatars.githubusercontent.com/u/10407640?v=3","gravatar_id":"","url":"https://api.github.com/users/arubalac","html_url":"https://github.com/arubalac","followers_url":"https://api.github.com/users/arubalac/followers","following_url":"https://api.github.com/users/arubalac/following{/other_user}","gists_url":"https://api.github.com/users/arubalac/gists{/gist_id}","starred_url":"https://api.github.com/users/arubalac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arubalac/subscriptions","organizations_url":"https://api.github.com/users/arubalac/orgs","repos_url":"https://api.github.com/users/arubalac/repos","events_url":"https://api.github.com/users/arubalac/events{/privacy}","received_events_url":"https://api.github.com/users/arubalac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-18T02:23:43Z","updated_at":"2015-05-18T02:23:43Z","closed_at":null,"body":"Hi,\r\n\r\nI was trying to generate RAML from a JAX-RS service with JAX-B supported model class. The RAML got generated successfully but it was observed that the XML example generated by the raml-for-jax-rs plugin was not constructing the elements which are having another class as its data type instead of string , integer or any collection type.\r\n\r\nFor instance a JAX_B class having <B>Name , Age and Address as its members<b> , where Name is a string , Age is a integer and <b>Address is another JAX-B supported class with street , building , pincode as its members</b>. \r\nWhen the utility generates the XML it will only generate the elements for Name and Age but its not generating the child elements for Address .\r\n\r\n<b><i>Sample model class</i></b>\r\nIn the below code the <b>usergroupSummary</b> element refers another class .\r\n<code>\r\npackage com.sample.rest;\r\n\r\nimport javax.xml.bind.annotation.XmlAccessType;\r\nimport javax.xml.bind.annotation.XmlAccessorType;\r\nimport javax.xml.bind.annotation.XmlElement;\r\nimport javax.xml.bind.annotation.XmlRootElement;\r\nimport javax.xml.bind.annotation.XmlTransient;\r\nimport javax.xml.bind.annotation.XmlType;\r\n\r\n/**\r\n *\r\n */\r\n//@SummaryField(value = \"usergroupSummary\")\r\n//@Relationship(key = \"usergroup\", template = \"/user-groups/{usergroupOid}\", appendPath = false)\r\n@XmlRootElement(name=\"user\")\r\n@XmlType(name=\"userType\")\r\n@XmlAccessorType(XmlAccessType.FIELD)\r\npublic class UserOutput extends BaseOutput {\r\n\r\n    private String usergroupOid;\r\n\r\n    //@JsonProperty(\"username\")\r\n    @XmlElement(name=\"username\")\r\n    private String userName;\r\n\r\n    //@XmlTransient\r\n    //private UserGroupSummary usergroupSummary;\r\n\r\n    //@JsonProperty(\"usergroup_summary\")\r\n    //@XmlElement(name=\"usergroup_summary\")\r\n    //@XmlTransient\r\n    //private HashMap<String, Object> usergroupSummaryData;\r\n\r\n    //@XmlElement(name=\"usergroup_summary\")\r\n    @XmlTransient\r\n    private GetResponseBean<UserGroupSummary> usergroupSummaryData;\r\n\r\n    @XmlElement(name=\"usergroup_summary1\")\r\n    private UserGroupSummary usergroupSummary;\r\n\r\n    //@JsonProperty(\"first_name\")\r\n    @XmlElement(name=\"first_name\")\r\n    private String firstName;\r\n\r\n    //@JsonProperty(\"last_name\")\r\n    @XmlElement(name=\"last_name\")\r\n    private String lastName;\r\n\r\n    @XmlElement\r\n    private String email;\r\n\r\n    @XmlElement\r\n    private String address;\r\n\r\n    //@JsonProperty(\"phone_number\")\r\n    @XmlElement(name=\"phone_number\")\r\n    private String phoneNumber;\r\n\r\n    @XmlElement\r\n    private String password;\r\n\r\n    @XmlElement\r\n    private String role;\r\n\r\n    // @JsonProperty(\"system_user\")\r\n    @XmlElement(name=\"system_user\")\r\n    private boolean systemUser;\r\n\r\n    //@JsonProperty(\"restricted_user\")\r\n    @XmlElement(name=\"restricted_user\")\r\n    private boolean restrictedUser;\r\n\r\n    public UserOutput() {\r\n        objectType = \"user\";\r\n    }\r\n\r\n    public boolean getSystemUser() {\r\n        return systemUser;\r\n    }\r\n\r\n    public void setSystemUser(boolean systemUser) {\r\n        this.systemUser = systemUser;\r\n    }\r\n\r\n    public boolean getRestrictedUser() {\r\n        return restrictedUser;\r\n    }\r\n\r\n    public void setRestrictedUser(boolean restrictedUser) {\r\n        this.restrictedUser = restrictedUser;\r\n    }\r\n\r\n    public String getUsergroupOid() {\r\n        return usergroupOid;\r\n    }\r\n\r\n    public void setUsergroupOid(String usergroupOid) {\r\n        this.usergroupOid = usergroupOid;\r\n    }\r\n\r\n    public String getUserName(){\r\n        return userName;\r\n    }\r\n\r\n    public void setUserName(String userName){\r\n        this.userName = userName;\r\n    }\r\n\r\n\r\n    public String getFirstName() {\r\n        return firstName;\r\n    }\r\n\r\n    public void setFirstName(String firstName) {\r\n        this.firstName = firstName;\r\n    }\r\n\r\n    public String getLastName() {\r\n        return lastName;\r\n    }\r\n\r\n    public void setLastName(String lastName) {\r\n        this.lastName = lastName;\r\n    }\r\n\r\n    public String getEmail() {\r\n        return email;\r\n    }\r\n\r\n    public void setEmail(String email) {\r\n        this.email = email;\r\n    }\r\n\r\n    public String getAddress() {\r\n        return address;\r\n    }\r\n\r\n    public void setAddress(String address) {\r\n        this.address = address;\r\n    }\r\n\r\n    public String getPhoneNumber() {\r\n        return phoneNumber;\r\n    }\r\n\r\n    public void setPhoneNumber(String phoneNumber) {\r\n        this.phoneNumber = phoneNumber;\r\n    }\r\n\r\n    public String getPassword() {\r\n        return password;\r\n    }\r\n\r\n    public void setPassword(String password) {\r\n        this.password = password;\r\n    }\r\n\r\n    public String getRole() {\r\n        return role;\r\n    }\r\n\r\n    public void setRole(String role) {\r\n        this.role = role;\r\n    }\r\n\r\n    /**\r\n     * @return the usergroupSummaryData\r\n     */\r\n    public GetResponseBean<UserGroupSummary> getUsergroupSummaryData() {\r\n        return usergroupSummaryData;\r\n    }\r\n\r\n    /**\r\n     * @param usergroupSummaryData the usergroupSummaryData to set\r\n     */\r\n    public void setUsergroupSummaryData(\r\n            GetResponseBean<UserGroupSummary> usergroupSummaryData) {\r\n        this.usergroupSummaryData = usergroupSummaryData;\r\n    }\r\n}\r\n</code>\r\n\r\nRegards\r\nArun"}}