diff --git a/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataResource.java b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataResource.java new file mode 100644 index 0000000..526d9af --- /dev/null +++ b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataResource.java @@ -0,0 +1,21 @@ +package dk.jyskebank.tools.enunciate.modules.openapi.confignamespacewithprefix; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import com.webcohesion.enunciate.metadata.rs.TypeHint; + +@Path("/path") +public class DataResource { + + @TypeHint(DataXmlDTO.class) + @GET + @Path("/xmldto") + @Produces(MediaType.APPLICATION_XML) + public Response getXmlType() { + return Response.ok(new DataXmlDTO()).build(); + } +} diff --git a/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataXmlDTO.java b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataXmlDTO.java new file mode 100644 index 0000000..9197ecb --- /dev/null +++ b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataXmlDTO.java @@ -0,0 +1,14 @@ +package dk.jyskebank.tools.enunciate.modules.openapi.confignamespacewithprefix; + +import javax.xml.bind.annotation.*; + +@XmlType(name = "dataXmlDTO", namespace = "http://www.jyskebank.dk/enunciate/openapi/version/1") +@XmlRootElement(name="dataXmlDTO", namespace = "http://www.jyskebank.dk/enunciate/openapi/version/1") +@XmlAccessorType(XmlAccessType.FIELD) +public class DataXmlDTO { + @XmlElement(name="aString") + private String aString; + + @XmlElement + private DataXmlEnum anEnum; +} diff --git a/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataXmlEnum.java b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataXmlEnum.java new file mode 100644 index 0000000..7285150 --- /dev/null +++ b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/DataXmlEnum.java @@ -0,0 +1,9 @@ +package dk.jyskebank.tools.enunciate.modules.openapi.confignamespacewithprefix; + +import javax.xml.bind.annotation.XmlEnum; + +@XmlEnum +public enum DataXmlEnum { + GOOD, + MORNING; +} diff --git a/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/RestApplication.java b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/RestApplication.java new file mode 100644 index 0000000..423d7cf --- /dev/null +++ b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/RestApplication.java @@ -0,0 +1,8 @@ +package dk.jyskebank.tools.enunciate.modules.openapi.confignamespacewithprefix; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("rest") +public class RestApplication extends Application { +} diff --git a/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/enunciate.xml b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/enunciate.xml new file mode 100644 index 0000000..b363657 --- /dev/null +++ b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/enunciate.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/openapi.yml b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/openapi.yml new file mode 100644 index 0000000..d83ae82 --- /dev/null +++ b/src/test/java/dk/jyskebank/tools/enunciate/modules/openapi/confignamespacewithprefix/openapi.yml @@ -0,0 +1,46 @@ +openapi: 3.0.0 +info: + title: "Web Service API" + version: "version" + description: "" +servers: [] +paths: + "/path/xmldto": + get: + description: "" + tags: + - "DataResource" + summary: "" + deprecated: false + operationId: getXmlType + responses: + "200": + description: "" + content: + "*/*": + schema: + $ref: "#/components/schemas/xml_prefix-a_dataXmlDTO" + +components: + schemas: + "xml_ns0_dataXmlEnum": + title: "dataXmlEnum" + type: string + enum: + - "GOOD" + - "MORNING" + "xml_prefix-a_dataXmlDTO": + title: "dataXmlDTO" + allOf: + - type: string + format: binary + - type: object + properties: + "aString": + type: string + "anEnum": + $ref: "#/components/schemas/xml_ns0_dataXmlEnum" + xml: + name: dataXmlDTO + namespace: http://www.jyskebank.dk/enunciate/openapi/version/1 + prefix: prefix-a