[ofbiz-plugins] branch trunk updated: Improved: Wrapped serviceIn query parameter schema in content to allow url encoding of values in Swagger UI(OFBIZ-11328)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-plugins] branch trunk updated: Improved: Wrapped serviceIn query parameter schema in content to allow url encoding of values in Swagger UI(OFBIZ-11328)

grv-2
This is an automated email from the ASF dual-hosted git repository.

grv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 88de8cd  Improved: Wrapped serviceIn query parameter schema in content to allow url encoding of values in Swagger UI(OFBIZ-11328)
88de8cd is described below

commit 88de8cd84551258b3a741623e8c2e958a627d6cf
Author: Girish Vasmatkar <[hidden email]>
AuthorDate: Wed Oct 14 12:20:31 2020 +0530

    Improved: Wrapped serviceIn query parameter schema in content to allow url encoding of values in Swagger UI(OFBIZ-11328)
---
 .../java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java b/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java
index 87aebe5..a993fb1 100644
--- a/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java
+++ b/ofbiz-rest-impl/src/main/java/org/apache/ofbiz/ws/rs/openapi/OFBizOpenApiReader.java
@@ -135,7 +135,8 @@ public final class OFBizOpenApiReader extends Reader implements OpenApiReader {
                                 .description("Operation Input Parameters in JSON").name("input");
                         Schema<?> refSchema = new Schema<>();
                         refSchema.$ref("#/components/schemas/" + "api.request." + service.getName());
-                        serviceInParam.schema(refSchema);
+                        serviceInParam.content(new Content().addMediaType(javax.ws.rs.core.MediaType.APPLICATION_JSON,
+                                new MediaType().schema(refSchema)));
                         operation.addParametersItem(serviceInParam);
                         operation.addParametersItem(HEADER_ACCEPT_JSON);
                     } else if (verb.matches(HttpMethod.POST + "|" + HttpMethod.PUT + "|" + HttpMethod.PATCH)) {
@@ -184,7 +185,8 @@ public final class OFBizOpenApiReader extends Reader implements OpenApiReader {
                                 .description("Service In Parameters in JSON").name("inParams");
                         Schema<?> refSchema = new Schema<>();
                         refSchema.$ref("#/components/schemas/" + "api.request." + service.getName());
-                        serviceInParam.schema(refSchema);
+                        serviceInParam.content(new Content().addMediaType(javax.ws.rs.core.MediaType.APPLICATION_JSON,
+                                new MediaType().schema(refSchema)));
                         operation.addParametersItem(serviceInParam);
                     }
                     operation.addParametersItem(HEADER_ACCEPT_JSON);