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
{{ message }}
Repository navigation
More convention: complex type should default to [Body] #89
Right now it seems like you need to put [Body] on a parameter you want to be in the body. How about reversing that or at least making the defaults based on the verb.
I.e., for PUT/POST, a complex type would go in the body and any other parameters to the query string.
for GET, a complex type would translate to a query string parameter along with any other parameters.
I kind of like the idea, because easy == awesome, but what if somebody wants a complex type serialized as a query parameter.
I guess we could do the following:
All parameters that appear in the URL template are always included in the URL, so complex types can be included as explicit querystring parameters (which I think we support already).
Add any other simple types as querystring parameters automatically (again, we already do this).
If there's only one complex type, treat it like it has an implicit [Body(BodySerializationMethod.Json)].
What do we do if there's more than one complex type though?
💥?
Only put the first one in the body and put any additional ones in the querystring?
I don't think we want to wind up in a situation where we need to add a [QueryString] or [Url] attribute.
One more thing: obviously, we'd want to treat any string as a simple type. Are there any other complex types we'd need to treat as simple types by default?
If there's more than one complex type, I think one of them has to have a [Body] attribute; otherwise there's no way to know what the user intended. I think it's weird to put a complex type on the query string for a put/post/patch but shrug
I don't think string should really ever be counted as a complex type anyway :P
Activity
bennor commentedon Dec 13, 2014
I kind of like the idea, because easy == awesome, but what if somebody wants a complex type serialized as a query parameter.
I guess we could do the following:
[Body(BodySerializationMethod.Json)].What do we do if there's more than one complex type though?
I don't think we want to wind up in a situation where we need to add a
[QueryString]or[Url]attribute.One more thing: obviously, we'd want to treat any
stringas a simple type. Are there any other complex types we'd need to treat as simple types by default?clairernovotny commentedon Dec 15, 2014
I agree with your assumptions above...
If there's more than one complex type, I think one of them has to have a [Body] attribute; otherwise there's no way to know what the user intended. I think it's weird to put a complex type on the query string for a put/post/patch but shrug
I don't think string should really ever be counted as a complex type anyway :P
Add support for detecting body param as per reactiveui#89
flagbug commentedon May 11, 2016
Closing this, as it seems to be fixed with #102