MicrosoftDocs / vsts-rest-api-specs

MIT License
164 stars 116 forks source link

Azure DevOps REST API - broken example and missing documentation in Configurations - Create #713

Open ruijarimba opened 2 months ago

ruijarimba commented 2 months ago

The Merge strategy policy example is broken.

POST https://dev.azure.com/fabrikam/fabrikam-fiber-git/_apis/policy/configurations?api-version=7.0

{
  "isEnabled": true,
  "isBlocking": true,
  "type": {
    "id": "fa4e907d-c16b-4a4c-9dfa-4916e5d171ab"
  },
  "settings": {
    "useSquashMerge": true,
    "scope": [
      {
        "repositoryId": "1d1dad71-f27c-4370-810d-838ec41efd41",
        "refName": "refs/heads/master",
        "matchKind": "exact"
      }
    ]
  }
}

useSquashMerge setting doesn't work in Azure DevOps Services (see SO issue), allowSquash should be used instead.

Also, I had to do a Google search in order to find the right settings for the Merge strategy policy:

These settings should be properly documented in the page. It would be great if the sample request listed above could include these settings as well.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Kanahowl commented 1 month ago

Thank you for your message, you helped me a lot.. didn't get why it wasn't working before. The keys were just not the right ones to use.