{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-core/issues/1502","labels_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/1502/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/1502/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/1502/events","html_url":"https://github.com/swagger-api/swagger-core/issues/1502","id":112066904,"number":1502,"title":"@XmlElement not working correctly on Fields if the xsd defined the name with first letter in uppercase","user":{"login":"Jerrrrrrry","id":15155465,"avatar_url":"https://avatars.githubusercontent.com/u/15155465?v=3","gravatar_id":"","url":"https://api.github.com/users/Jerrrrrrry","html_url":"https://github.com/Jerrrrrrry","followers_url":"https://api.github.com/users/Jerrrrrrry/followers","following_url":"https://api.github.com/users/Jerrrrrrry/following{/other_user}","gists_url":"https://api.github.com/users/Jerrrrrrry/gists{/gist_id}","starred_url":"https://api.github.com/users/Jerrrrrrry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jerrrrrrry/subscriptions","organizations_url":"https://api.github.com/users/Jerrrrrrry/orgs","repos_url":"https://api.github.com/users/Jerrrrrrry/repos","events_url":"https://api.github.com/users/Jerrrrrrry/events{/privacy}","received_events_url":"https://api.github.com/users/Jerrrrrrry/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-19T03:52:49Z","updated_at":"2015-10-20T22:18:47Z","closed_at":"2015-10-19T21:58:57Z","body":"The pet.xsd defined Pet schema, please note that two fields Name and Address are both defined with first letter in uppercase.\r\n```\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\r\n\txmlns:tns=\"http://github.com/mytest/pet\" targetNamespace=\"http://github.com/mytest/pet\"\r\n\telementFormDefault=\"qualified\" attributeFormDefault=\"unqualified\">\r\n\r\n\t<xs:element name=\"Pet\">\r\n\t\t<xs:complexType>\r\n\t\t\t<xs:sequence>\r\n\t\t\t\t<xs:element maxOccurs=\"1\" minOccurs=\"1\" ref=\"tns:Name\" />\r\n\t\t\t\t<xs:element maxOccurs=\"1\" minOccurs=\"0\" ref=\"tns:Address\" />\r\n\t\t\t</xs:sequence>\r\n\t\t</xs:complexType>\r\n\t</xs:element>\r\n\t<xs:element name=\"Name\">\r\n\t\t<xs:simpleType>\r\n\t\t\t<xs:annotation>\r\n\t\t\t\t<xs:documentation xml:lang=\"en\">\r\n\t\t\t\t\tdefine the pet's name\r\n\t\t\t\t</xs:documentation>\r\n\t\t\t</xs:annotation>\r\n\t\t\t<xs:restriction base=\"xs:string\">\r\n\t\t\t\t<xs:minLength value=\"1\" />\r\n\t\t\t\t<xs:maxLength value=\"20\" />\r\n\t\t\t\t<xs:pattern value=\"([a-zA-Z0-9])*\" />\r\n\t\t\t</xs:restriction>\r\n\t\t</xs:simpleType>\r\n\t</xs:element>\r\n\r\n\t<xs:element name=\"Address\">\r\n\t\t<xs:simpleType>\r\n\t\t\t<xs:annotation>\r\n\t\t\t\t<xs:documentation xml:lang=\"en\">\r\n\t\t\t\t\tdefine the pet's location\r\n\t\t\t\t</xs:documentation>\r\n\t\t\t</xs:annotation>\r\n\t\t\t<xs:restriction base=\"xs:string\" />\r\n\t\t</xs:simpleType>\r\n\t</xs:element>\r\n</xs:schema>\r\n```\r\nadd jaxb stuff in pom.xml\r\n\r\n\t<groupId>org.jvnet.jaxb2.maven2</groupId>\r\n\t<artifactId>maven-jaxb2-plugin</artifactId>\r\n\t<executions>\r\n\t\t<execution>\r\n\t\t\t<id>xjc</id>\r\n\t\t\t<phase>generate-sources</phase>\r\n\t\t\t<goals>\r\n\t\t\t\t<goal>generate</goal>\r\n\t\t\t</goals>\r\n\t\t</execution>\r\n\t</executions>\r\n\t<configuration>\r\n\t\t<schemaDirectory>pet.xsd</schemaDirectory>\r\n\t\t<generateDirectory>generated</generateDirectory>\r\n\t\t<forceRegenerate>true</forceRegenerate>\r\n\t</configuration>\r\n\r\n\r\nthe jaxb plugin will compile the above xsd file to java class Pet.java:\r\n```\r\n@XmlRootElement(name = \"Pet\")\r\npublic class Pet {\r\n\t@XmlElement(name = \"Name\")\r\n\tprotected String name;\r\n\r\n\t@XmlElement(name = \"Address\")\r\n\tprotected String address;\r\n\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}\r\n\r\n\tpublic void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}\r\n\r\n\tpublic String getAddress() {\r\n\t\treturn address;\r\n\t}\r\n\r\n\tpublic void setAddress(String address) {\r\n\t\tthis.address = address;\r\n\t}\r\n}\r\n```\r\nso far, everything seems good: see below rest service definition \r\n```\r\n@Path(\"/pet\")\r\n@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })\r\n@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })\r\n@Api(value = \"/pet\", consumes = \"application/json, application/xml\", produces = \"application/json, application/xml\")\r\n\r\npublic class PetController {\r\n\r\n\t@Autowired\r\n\tprivate PetService petService;\r\n\r\n\t@POST\r\n\t@Path(\"/savePet\")\r\n\r\n\t@ApiOperation(value = \"save a pet with name and address\", response = PetResponse.class)\r\n\t@ApiResponses(value = { @ApiResponse(code = 200, message = \"Success\", response = PetResponse.class) })\r\n\tpublic Response savePet(Pet request) {\r\n\t\treturn petService.savePet(request);\r\n\t}\r\n}\r\n```\r\nin the api doc, swagger.yaml, I am expecting the Parameters of body like below:\r\n▼Pet {\r\nName: string *       \r\nAddress:string\r\n} \r\n\r\nbut actually I get \r\n▼Pet {\r\nname: string *       \r\naddress:string\r\n} \r\n\r\nand this is really causing my swagger test could not run, as the request is sending parameters \"name\" instead of \"Name\", \"address\" instead of \"Address\", the rest service could not get the proper value. if I manually set the request from name to Name, address to Address then the rest service works good.\r\n \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-core/issues/comments/149718878","html_url":"https://github.com/swagger-api/swagger-core/issues/1502#issuecomment-149718878","issue_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/1502","id":149718878,"user":{"login":"webron","id":241629,"avatar_url":"https://avatars.githubusercontent.com/u/241629?v=3","gravatar_id":"","url":"https://api.github.com/users/webron","html_url":"https://github.com/webron","followers_url":"https://api.github.com/users/webron/followers","following_url":"https://api.github.com/users/webron/following{/other_user}","gists_url":"https://api.github.com/users/webron/gists{/gist_id}","starred_url":"https://api.github.com/users/webron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webron/subscriptions","organizations_url":"https://api.github.com/users/webron/orgs","repos_url":"https://api.github.com/users/webron/repos","events_url":"https://api.github.com/users/webron/events{/privacy}","received_events_url":"https://api.github.com/users/webron/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T22:18:47Z","updated_at":"2015-10-20T22:18:47Z","body":"@Jerrrrrrry - you can add the code at any place in your code that runs when your application starts up. If you don't have such a code, you can create a simple bootstrap servlet to handle it."}}