yhs0092 commented on a change in pull request #815:  [SCB-708] Aggregate simple 
query params into object param in spring mvc style
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/815#discussion_r203096257
 
 

 ##########
 File path: 
swagger/swagger-generator/generator-springmvc/src/main/java/org/apache/servicecomb/swagger/generator/springmvc/processor/parameter/SpringmvcDefaultObjectParameterProcessor.java
 ##########
 @@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.swagger.generator.springmvc.processor.parameter;
+
+import java.lang.reflect.Type;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.servicecomb.swagger.generator.core.DefaultParameterProcessor;
+import org.apache.servicecomb.swagger.generator.core.OperationGenerator;
+import org.apache.servicecomb.swagger.generator.core.utils.ParamUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import io.swagger.converter.ModelConverters;
+import io.swagger.models.Model;
+import io.swagger.models.parameters.AbstractSerializableParameter;
+import io.swagger.models.parameters.QueryParameter;
+import io.swagger.models.properties.Property;
+import io.swagger.models.properties.RefProperty;
+
+/**
+ * Flatten a object parameter into a set of flatten simple parameters.
+ * <p/>
+ * <em>Nesting object params and generic Object params are NOT supported.</em>
+ * We support query object just for aggregating query params instead of 
transporting objects in query param.
+ * So we don't support a generic param whose generic type is complex, but a 
simple generic type param can be supported.
+ */
+public class SpringmvcDefaultObjectParameterProcessor implements 
DefaultParameterProcessor {
+
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(SpringmvcDefaultObjectParameterProcessor.class);
+
+  @Override
+  public void process(OperationGenerator operationGenerator, int paramIndex) {
+    Model paramModel = getParamModel(operationGenerator, paramIndex);
+
+    if (null == paramModel) {
+      LOGGER.warn("cannot find param, provider method is [{}], paramIndex = 
[{}]",
 
 Review comment:
   OK, then should I throw an Exception to break this process?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to