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

Introduce support for nested objects #455

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

onliner10
Copy link

At work, we encountered a case where we have contract classes (DTOs) containing another DTOs, being nested objects. It seemed that Flurl doesn't support this currently, while e.g. ASP.NET MVC model binder can correctly deserialize them from GET query parameters.

Hence the PR, introducing support for serializing nested object by composing property names using a dot.

By the way, I modified can_set_timeout_and_cancellation_token test to expect OperationCancelledException instead of TaskCancelledException, because it simply wouldn't pass on my machine otherwise. I'm not entirely sure that's correct, but it seems reasonable since OperationCancelledException is a base class and also represents cancellation.

@tmenier
Copy link
Owner

tmenier commented Jul 19, 2019

Thanks, it's an interesting idea and I'll give it some thought. It is of course a breaking change for anyone expecting custom objects to get ToString'd. An alternative might simply be a SetQueryParamNested extension method for your own usage. I'd recommend that as a way forward for now.

Is this related to an open issue? If not, could you create one? Otherwise I tend to forget about PRs. And generally, I prefer discussing new features first per the contribution guidelines, just so you don't risk doing a bunch of wasted work.

@onliner10
Copy link
Author

Created #457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants