You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by il...@apache.org on 2018/01/05 10:36:47 UTC
[cxf] branch 3.1.x-fixes updated: [CXF-7525] Fixing enum support
This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch 3.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/3.1.x-fixes by this push:
new a5d873b [CXF-7525] Fixing enum support
a5d873b is described below
commit a5d873b97dc15ce3bb5a6fcd1f9efa50e7f25901
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Fri Jan 5 11:36:16 2018 +0100
[CXF-7525] Fixing enum support
---
.../cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java
index 63e3274..e3ebb39 100644
--- a/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java
+++ b/rt/rs/description-swagger/src/main/java/org/apache/cxf/jaxrs/swagger/openapi/SwaggerToOpenApiConversionUtils.java
@@ -244,7 +244,7 @@ public final class SwaggerToOpenApiConversionUtils {
} else if ("formData".equals(sw2PathVerbParamMap.getStringProperty("in"))) {
it.remove();
if (sw3formBody == null) {
- sw3formBody = new LinkedList<JsonMapObject>();
+ sw3formBody = new LinkedList<>();
sw3RequestBody = new JsonMapObject();
}
sw2PathVerbParamMap.removeProperty("in");
@@ -262,9 +262,13 @@ public final class SwaggerToOpenApiConversionUtils {
sw2PathVerbParamMap.setProperty("schema", schema);
} else {
String type = (String)sw2PathVerbParamMap.removeProperty("type");
+ Object enumK = sw2PathVerbParamMap.removeProperty("enum");
if (type != null) {
JsonMapObject schema = new JsonMapObject();
schema.setProperty("type", type);
+ if (enumK != null) {
+ schema.setProperty("enum", enumK);
+ }
for (String prop : SIMPLE_TYPE_RELATED_PROPS) {
Object value = sw2PathVerbParamMap.removeProperty(prop);
if (value != null) {
--
To stop receiving notification emails like this one, please contact
['"commits@cxf.apache.org" <co...@cxf.apache.org>'].