You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While there is support added via annotations and CollectionFormatConverterFactory.kt this does not work and will instead pass the parameters as multiple values.
E.g. snippet definition snippet:
This happens because Retrofit applies the converter on a per value basis so the type check in CollectionFormatConverter will always go through the string branch returning an unmodified value which than gets appended to the query as an extra parameter.
Looking at the retrofit code (RequestFactory.java#L442) if we get an Iterable, than each value in that list will get converted and added to the query. So while our CSV stringConverter is selected, it will never get applied as we want it to be.
While I have a few ideas on how to approach this, they all involve making ParameterHandler.java in Retrofit, aware of apply'ing the conversion as a single value if a converter exists while keeping the current multi-value behavior for the BuiltInConverter string converter.
This does imply a significant change in Retrofit but maybe I'm missing something and there's already a better way to do this.
Any ideas? @JakeWharton maybe you could share your perspective.
The text was updated successfully, but these errors were encountered:
While there is support added via annotations and CollectionFormatConverterFactory.kt this does not work and will instead pass the parameters as multiple values.
E.g. snippet definition snippet:
This happens because Retrofit applies the converter on a per value basis so the type check in
CollectionFormatConverter
will always go through the string branch returning an unmodified value which than gets appended to the query as an extra parameter.Looking at the retrofit code (RequestFactory.java#L442) if we get an Iterable, than each value in that list will get converted and added to the query. So while our CSV stringConverter is selected, it will never get applied as we want it to be.
While I have a few ideas on how to approach this, they all involve making ParameterHandler.java in Retrofit, aware of apply'ing the conversion as a single value if a converter exists while keeping the current multi-value behavior for the BuiltInConverter string converter.
This does imply a significant change in Retrofit but maybe I'm missing something and there's already a better way to do this.
Any ideas? @JakeWharton maybe you could share your perspective.
The text was updated successfully, but these errors were encountered: