From 16589de9759a4e1b434d74167b9042b8659caf59 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 23 Apr 2018 16:14:45 +0800 Subject: [PATCH] default collection format to csv according to the spec (#201) --- .../src/main/java/org/openapitools/codegen/DefaultCodegen.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 87a89b5dfb..b09866db4a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -2595,7 +2595,8 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.items = codegenProperty.items; } - codegenParameter.collectionFormat = collectionFormat; + // default to csv + codegenParameter.collectionFormat = StringUtils.isEmpty(collectionFormat) ? "csv" : collectionFormat; if ("multi".equals(collectionFormat)) { codegenParameter.isCollectionFormatMulti = true; }