liubao68 commented on a change in pull request #1250: [SCB-1336][WIP][WEAK]
should not lost @ApiParam description when wrap parameter to body at swagger
generator pojo mode
URL:
https://github.com/apache/servicecomb-java-chassis/pull/1250#discussion_r298862393
##########
File path:
swagger/swagger-generator/generator-core/src/main/java/org/apache/servicecomb/swagger/generator/pojo/PojoOperationGenerator.java
##########
@@ -83,9 +83,14 @@ private void wrapParametersToBody(List<ParameterGenerator>
bodyFields) {
bodyModel = new ModelImpl();
bodyModel.setType(ModelImpl.OBJECT);
for (ParameterGenerator parameterGenerator : bodyFields) {
- SwaggerUtils.addDefinitions(swagger,
parameterGenerator.getGenericType());
+ parameterGenerator.setHttpParameterType(HttpParameterType.BODY);
+ scanMethodParameter(parameterGenerator);
+
Property property =
ModelConverters.getInstance().readAsProperty(parameterGenerator.getGenericType());
+
property.setDescription(parameterGenerator.getGeneratedParameter().getDescription());
bodyModel.addProperty(parameterGenerator.getParameterName(), property);
+
+ parameterGenerator.setHttpParameterType(null);
Review comment:
This code is a bit confusing. Should HttpParameterType set to the original
one or it is always BODY?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services