replace body parameter naming extension (#412)

This commit is contained in:
William Cheng
2018-05-10 16:00:38 +08:00
committed by GitHub
parent dc4d6e499c
commit 2d60c082b2

View File

@@ -2228,8 +2228,8 @@ public class DefaultCodegen implements CodegenConfig {
}
String bodyParameterName = "";
if (op.vendorExtensions != null && op.vendorExtensions.containsKey("x-codegen-body-parameter-name")) {
bodyParameterName = (String) op.vendorExtensions.get("x-codegen-body-parameter-name");
if (op.vendorExtensions != null && op.vendorExtensions.containsKey("x-codegen-request-body-name")) {
bodyParameterName = (String) op.vendorExtensions.get("x-codegen-request-body-name");
}
bodyParam = fromRequestBody(requestBody, schemas, imports, bodyParameterName);
bodyParam.description = requestBody.getDescription();