Skip to content

[ClientRuntime] Added PATCH as a valid method when Created status is returned on LRO#3601

Closed
ScottHolden wants to merge 1 commit intoAzure:psSdkJson6from
ScottHolden:azureRestPATCHCreatedResponse
Closed

[ClientRuntime] Added PATCH as a valid method when Created status is returned on LRO#3601
ScottHolden wants to merge 1 commit intoAzure:psSdkJson6from
ScottHolden:azureRestPATCHCreatedResponse

Conversation

@ScottHolden
Copy link
Copy Markdown
Contributor

@ScottHolden ScottHolden commented Aug 18, 2017

Description

As per #3592 , PATCH long running operations return a 'Created' HTTP status code. This change adds this as a valid response.


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

SDK Generation Guidelines

  • If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
  • The generate.cmd file for the SDK has been updated with the version of AutoRest, as well as the commitid of your swagger spec or link to the swagger spec, used to generate the code.
  • The *.csproj and AssemblyInfo.cs files have been updated with the new version of the SDK.

@azuresdkci
Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

1 similar comment
@azuresdkci
Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

@msftclas
Copy link
Copy Markdown

@ScottHolden,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by Microsoft. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

var method = initialResponse.Request.Method;
if (statusCode == HttpStatusCode.OK || statusCode == HttpStatusCode.Accepted ||
(statusCode == HttpStatusCode.Created && method == HttpMethod.Put) ||
(statusCode == HttpStatusCode.Created && (method == HttpMethod.Put || method == new HttpMethod("PATCH"))) ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ScottHolden this change is already put in for the next release for ClientRuntime and is being tracked by #3592
Just curious what scenarios that you have for which you need this fix?
Also all such contributions need test coverage, else the PR will be not be accepted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @shahabhijeet , this change is required for the EventGrid client ( #3600 )

Did you want me to write up some tests for this, or should I close this ahead of Microsoft internally doing the work?

@shahabhijeet
Copy link
Copy Markdown
Contributor

@ScottHolden this is no longer needed as a PR has been opened to fix this issue.
#3625

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.

4 participants