CenterEdge / Yardarm

OpenAPI 3 SDK Generator for C#
Apache License 2.0
44 stars 6 forks source link

Correctly handle `array` query string parameters #148

Closed brantburnett closed 1 year ago

brantburnett commented 1 year ago

Motivation

When a query string parameter is of type array there are special serialization rules. Currently, Yardarm is ignoring those rules and simply calling ToString() on the list and passing that as the value on the query string.

Modifications

Drop the OperationHelper and instead create a QueryStringBuilder which appends each query string element, if not null, using the correct rules. The approach has the following details:

Also upgrade Microsoft.OpenApi to get correct deserialization of the default value for explode on query parameters.

Results

Primitives and arrays are now handled correctly on query strings. Deep objects are still not implemented at this time.

Fixes #146

brantburnett commented 1 year ago

/merge