title: Empty grammar in WADL (Jersey)
body: <p>I am developing a server using Jersey JAX-RS. When I access the application WADL, it contains the description of all operations, but no reference to the XML schema (the grammar element is empty).</p>
  
  <p>Here is a simplified version of what I have.
  XML schema:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;xsd:element name="parent" type="Parent" /&gt;
  &lt;xsd:complexType name="Parent"&gt;
      &lt;xsd:sequence&gt;
          &lt;xsd:element name="son" minOccurs="0" maxOccurs="unbounded"&gt;
              &lt;xsd:complexType&gt;
                  &lt;xsd:attribute name="name" type="xsd:string" use="required" /&gt;
              &lt;/xsd:complexType&gt;
          &lt;/xsd:element&gt;
      &lt;/xsd:sequence&gt;
      &lt;xsd:attribute name="name" type="xsd:string" use="required"/&gt;
  &lt;/xsd:complexType&gt;
  </code></pre>
  
  <p>Here a .java for handling requests, the class Parent is generated by JAXB automatic generation. <em>The code compiles and handle requests just fine, if there are syntax errors it's just because I reproduced a minimal portion of the code.</em></p>
  
  <pre><code>@Path("/parents")
  public class ParentAPI {
      private static ObjectFactory jaxbOf = new ObjectFactory();
  
      @GET
      @ApiOperation(value = "getParent")
      @ApiResponses(value = { @ApiResponse(code = 200, message = "OK"),
              @ApiResponse(code = 500, message = "Internal Server Error") })
      @Produces({ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
      @Path("/{name}")
      public JAXBElement&lt;Parent&gt; getParent(@PathParam("name") String name) {
          Parent parent = new Parent();
          //.....
          return jaxbOf.createParent(parent);
      }
  
      @POST
      @ApiOperation(value = "postParent")
      @ApiResponses(
              value = { @ApiResponse(code = 201, message = "Created"), @ApiResponse(code = 400, message = "Bad request"),
                      @ApiResponse(code = 500, message = "Internal Server Error") })
      @Produces({ MediaType.TEXT_XML })
      @Consumes({ MediaType.APPLICATION_XML })
      public Response postNode(JAXBElement&lt;Parent&gt; jaxbParent, @Context UriInfo uriInfo) {
          Parent parent = jaxbParent.getValue();
          //.....
  
          UriBuilder builder = uriInfo.getAbsolutePathBuilder();
          URI u = builder.path(parent.getName()).build();
          return Response.created(u).build();
  
      }
  }
  </code></pre>
  
  <p>I am using JAXBElement&lt;> wrapper because I have named complexTypes in the schema. Moreover, I am using a validator implementing <code>MessageBodyReader&lt;JAXBElement&lt;?&gt;</code>.</p>
  
  <p>This is the web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://xmlns.jcp.org/xml/ns/javaee"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
      id="WebApp_ID" version="3.1"&gt;
      &lt;display-name&gt;Example&lt;/display-name&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Jersey RESTful Application&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
              &lt;param-value&gt;io.swagger.jaxrs.listing, it.example&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Jersey2Config&lt;/servlet-name&gt;
          &lt;servlet-class&gt;io.swagger.jersey.config.JerseyJaxrsConfig&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;api.version&lt;/param-name&gt;
              &lt;param-value&gt;1.0.0&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;swagger.api.basepath&lt;/param-name&gt;
              &lt;param-value&gt;http://localhost:8080/Example/rest&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Jersey RESTful Application&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Now, I tried to expose the xsd putting it into the WebContent, but still no luck, and it does not appear in the WADL (autogenerated). I am compiling and packaging using ANT.</p>
  
  <p>I searched carefully in other questions, someone have no answer, others are old and suggests solutions using Servlet library I don't have (and I can't add, because it is an assignment and we have a set of libraries we can use), and looks like in Jersey the schema should be in the WADL by default, so I really can't understand what is wrong.</p>