From 80384e81d83acfacdab51eb618205bcee055507c Mon Sep 17 00:00:00 2001 From: Ryan Heaton Date: Mon, 21 Mar 2022 11:44:48 -0600 Subject: [PATCH] support for java.io.Serializable as a known type; fixes #1104 --- .../enunciate/modules/jackson/EnunciateJacksonContext.java | 1 + .../enunciate/modules/jackson1/EnunciateJackson1Context.java | 1 + .../webcohesion/enunciate/modules/jaxb/EnunciateJaxbContext.java | 1 + 3 files changed, 3 insertions(+) diff --git a/jackson/src/main/java/com/webcohesion/enunciate/modules/jackson/EnunciateJacksonContext.java b/jackson/src/main/java/com/webcohesion/enunciate/modules/jackson/EnunciateJacksonContext.java index 1bb0b8b1a..7d2ff7b26 100644 --- a/jackson/src/main/java/com/webcohesion/enunciate/modules/jackson/EnunciateJacksonContext.java +++ b/jackson/src/main/java/com/webcohesion/enunciate/modules/jackson/EnunciateJacksonContext.java @@ -226,6 +226,7 @@ protected Map loadKnownTypes() { knownTypes.put(java.net.URI.class.getName(), KnownJsonType.STRING); knownTypes.put(java.net.URL.class.getName(), KnownJsonType.STRING); knownTypes.put(java.lang.Object.class.getName(), KnownJsonType.OBJECT); + knownTypes.put(java.io.Serializable.class.getName(), KnownJsonType.OBJECT); knownTypes.put(byte[].class.getName(), KnownJsonType.STRING); knownTypes.put(java.nio.ByteBuffer.class.getName(), KnownJsonType.STRING); knownTypes.put(DataHandler.class.getName(), KnownJsonType.STRING); diff --git a/jackson1/src/main/java/com/webcohesion/enunciate/modules/jackson1/EnunciateJackson1Context.java b/jackson1/src/main/java/com/webcohesion/enunciate/modules/jackson1/EnunciateJackson1Context.java index 5fdca1ff7..06866863b 100644 --- a/jackson1/src/main/java/com/webcohesion/enunciate/modules/jackson1/EnunciateJackson1Context.java +++ b/jackson1/src/main/java/com/webcohesion/enunciate/modules/jackson1/EnunciateJackson1Context.java @@ -207,6 +207,7 @@ protected Map loadKnownTypes() { knownTypes.put(java.net.URI.class.getName(), KnownJsonType.STRING); knownTypes.put(java.net.URL.class.getName(), KnownJsonType.STRING); knownTypes.put(java.lang.Object.class.getName(), KnownJsonType.OBJECT); + knownTypes.put(java.io.Serializable.class.getName(), KnownJsonType.OBJECT); knownTypes.put(byte[].class.getName(), KnownJsonType.STRING); knownTypes.put(java.nio.ByteBuffer.class.getName(), KnownJsonType.STRING); knownTypes.put(DataHandler.class.getName(), KnownJsonType.STRING); diff --git a/jaxb/src/main/java/com/webcohesion/enunciate/modules/jaxb/EnunciateJaxbContext.java b/jaxb/src/main/java/com/webcohesion/enunciate/modules/jaxb/EnunciateJaxbContext.java index 15006f74e..436f64e64 100644 --- a/jaxb/src/main/java/com/webcohesion/enunciate/modules/jaxb/EnunciateJaxbContext.java +++ b/jaxb/src/main/java/com/webcohesion/enunciate/modules/jaxb/EnunciateJaxbContext.java @@ -191,6 +191,7 @@ protected Map loadKnownTypes() { knownTypes.put(java.net.URI.class.getName(), KnownXmlType.STRING); knownTypes.put(javax.xml.datatype.Duration.class.getName(), KnownXmlType.DURATION); knownTypes.put(java.lang.Object.class.getName(), KnownXmlType.ANY_TYPE); + knownTypes.put(java.io.Serializable.class.getName(), KnownXmlType.ANY_TYPE); knownTypes.put(byte[].class.getName(), KnownXmlType.BASE64_BINARY); knownTypes.put(java.nio.ByteBuffer.class.getName(), KnownXmlType.BASE64_BINARY); knownTypes.put(java.awt.Image.class.getName(), KnownXmlType.BASE64_BINARY);