Skip to content

Conversation

@russcam
Copy link
Contributor

@russcam russcam commented Apr 28, 2018

This commit fixes the selection of HTTP method for an index request based
on the presence of an explicilty set Id, or an Id value that can be inferred from
the document.

In the previous implementation, the IUrlParameter.GetString() method on the Id type
evaluated the Document to infer an Id from it, setting the internal Value of the Id to this
inferred value. As part of refactoring, this assignment was removed, which changes the
behaviour of the client when determining the HTTP method for an index request; in this
scenario, it is not enough to look to see if the Id type has a value, or that the Document is
not null, we need to know at this point that an Id can be inferred from the Document, and can
thereby send a PUT request.

An Id is inferred from the Document before the HTTP method is determined as part of resolving
RouteValues, so this commit changes the implementation to check if Id has a value, or
RouteValues.Id has a value.

This commit fixes the selection of HTTP method for an index request based
on the presence of an explicilty set Id, or an Id value that can be inferred from
the document.

In the previous implementation, the IUrlParameter.GetString() method on the Id type
evaluated the Document to infer an Id from it, setting the internal Value of the Id to this
inferred value. As part of refactoring, this assignment was removed, which changes the
behaviour of the client when determining the HTTP method for an index request; in this
scenario, it is not enough to look to see if the Id type has a value, or that the Document is
not null, we need to know at this point that an Id can be inferred from the Document, and can
thereby send a PUT request.

An Id is inferred from the Document before the HTTP method is determined as part of resolving
RouteValues, so this commit changes the implementation to check if Id has a value, or
RouteValues.Id has a value.
@russcam russcam requested a review from codebrain April 30, 2018 00:06
Copy link
Contributor

@codebrain codebrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great detective work

@russcam russcam merged commit 948cbb1 into master Apr 30, 2018
russcam added a commit that referenced this pull request Apr 30, 2018
This commit fixes the selection of HTTP method for an index request based
on the presence of an explicilty set Id, or an Id value that can be inferred from
the document.

In the previous implementation, the IUrlParameter.GetString() method on the Id type
evaluated the Document to infer an Id from it, setting the internal Value of the Id to this
inferred value. As part of refactoring, this assignment was removed, which changes the
behaviour of the client when determining the HTTP method for an index request; in this
scenario, it is not enough to look to see if the Id type has a value, or that the Document is
not null, we need to know at this point that an Id can be inferred from the Document, and can
thereby send a PUT request.

An Id is inferred from the Document before the HTTP method is determined as part of resolving
RouteValues, so this commit changes the implementation to check if Id has a value, or
RouteValues.Id has a value.
(cherry picked from commit 948cbb1)
@russcam russcam deleted the fix/index-httpmethod branch April 30, 2018 00:35
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.

3 participants