Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix query collection format inside object #896

Merged
merged 1 commit into from
Apr 8, 2020
Merged

Fix query collection format inside object #896

merged 1 commit into from
Apr 8, 2020

Conversation

Dreamescaper
Copy link
Contributor

@Dreamescaper Dreamescaper commented Apr 7, 2020

What kind of change does this PR introduce?
Fixes #894

What is the current behavior?
a) If query attribute is present on query object property, value is simply converted ToString.
b) CollectionFormat (both in RefitSettings and in QueryAttribute) is ignored when used on query object property. Interesting enough, it differs depending on item type - for enum or int it is Csv (because that is default), for object - Multi (because that how it is defined in BuildQueryMap method - no idea why).

What is the new behavior?
a) Value is formatted to string only when explicit Format is defined in Query attribute.
b) Collections in query objects are formatted same as regular query collections - accounting for CollectionFormat in RefitSettings and in QueryAttribute.

What might this PR break?

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:
Extracted part with collection values formatting from ParseQueryParameter to separate method ParseEnumerableQueryParameterValue to be able to reuse inside of BuildQueryMap.

Also updated RequestBuilder tests to use nameof for method names - much easier to see where particular method is used, hope you don't mind.

@clairernovotny clairernovotny merged commit 838adba into reactiveui:master Apr 8, 2020
@Dreamescaper Dreamescaper deleted the fix_query_collection_format_inside_model branch April 8, 2020 13:32
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Formatting of query parameter decorated by Collection.Multi changed between version 5.0.23 and 5.1.27
2 participants