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:
List vs non-list is handled differently on the generation side using a different method call and generics used. Both of these allow us to avoid the use of reflection
The QueryStringBuilder is never instantiated for URIs that don't have query string parameters
Uses the LiteralSerializer under the hood to better handle primitives such as booleans
Query parameter names are url-encoded at SDK generation time instead of for each request
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.
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 aQueryStringBuilder
which appends each query string element, if not null, using the correct rules. The approach has the following details:LiteralSerializer
under the hood to better handle primitives such as booleansAlso 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