Description
If we have an XML schema with a simpleType that has a restriction, the tool is not able to determine the basic type of java.
Example:
<xs:simpleType name="DetailType">
<xs:annotation>
<xs:documentation>DetailType for WADL is used to indicate the possible values for a WADL Resource parameter.
This parameter specifies the desired amount of information to be returned.
For example, it is possible to instruct the web service to return only basic information about the maintainable artefact (i.e.: id, agency id, version and name).
Most notably, items of item schemes will not be returned (for example, it will not return the codes in a code list query).
Possible values are: "allstubs" (all artefacts should be returned as stubs ), "referencestubs" (referenced artefacts should be returned as stubs )
and full (all available information for all artefacts should be returned ).
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="allstubs"/>
<xs:pattern value="referencestubs"/>
<xs:pattern value="full"/>
</xs:restriction>
</xs:simpleType>
And the generated code is:
@Path("datastructure/
{agencyID}/{resourceID}/{version}")public interface Datastructure { @GET @Produces("application/vnd.sdmx.structure+xml;version=2.1") StructureType MaintainableArtefactQuery(@QueryParam("detail") @DefaultValue("full") DetailType detail, @QueryParam("references") @DefaultValue("none") ReferencesType references); }
But DetailType doen't have JAXB binding because is a simpleType (a String). The the correct code would be:
@Path("datastructure/{agencyID}
/
{resourceID}/
{version}")
public interface Datastructure
Please run the attached code (mvn generate-sources with java parameters -Xms512M -Xmx1024M) to reproduce the issue. Then see for example the class "Datastructure".