Skip to content

Commit 7c9fac2

Browse files
committed
Add condition to ensure collectionFormat is only written out if schema type is array
1 parent 7637861 commit 7c9fac2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.OpenApi/Models/OpenApiParameter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public void SerializeAsV2WithoutReference(IOpenApiWriter writer)
377377
// allowEmptyValue
378378
writer.WriteProperty(OpenApiConstants.AllowEmptyValue, AllowEmptyValue, false);
379379

380-
if (this.In == ParameterLocation.Query)
380+
if (this.In == ParameterLocation.Query && Schema?.Type == "array")
381381
{
382382
if (this.Style == ParameterStyle.Form && this.Explode == true)
383383
{

0 commit comments

Comments
 (0)