Skip to content

PATCH LRO should trigger a linter rule #3676

@lmazuel

Description

@lmazuel

Clear and concise description of the problem

https://github.com/microsoft/api-guidelines/blob/577874dc49093ae8f6c4a5996a8f030d3ffbda7b/azure/ConsiderationsForServiceDesign.md#long-running-action-operations

PATCH must never be used for long-running operations: it should be reserved for simple resource updates. If a long-running update is required it should be implemented with POST.

Easy way to repro:

  @patch
  createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;

does generate a Swagger with a PATCH LRO, and there was never a linter issue:

      "patch": {
        "operationId": "Employees_CreateOrUpdate",
...
        "x-ms-long-running-operation": true

Checklist

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For feature request in the typespec language or core libraries file it in the TypeSpec repo
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

Labels

needs-areaneeds-infoMark an issue that needs reply from the author or it will be closed automatically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions