microsoft / azure-devops-rust-api

Rust API crate for the Azure DevOps API
MIT License
60 stars 20 forks source link

`git::items::list` `recursion_level` should be an enum rather than a String #78

Open johnbatty opened 2 years ago

johnbatty commented 2 years ago

The current API defines the git::items::list::ClientBuilder::recursion_level() function to take an Into<String> parameter:

pub fn recursion_level(self, recursion_level: impl Into<String>) -> Self
// The recursion level of this request. The default is ‘none’, no recursion.

However the operation only takes a fixed set of values:

Should fix up the spec to make this parameter an enum with the set of valid values. See VersionControlRecursionType

johnbatty commented 2 years ago

Worth noting that the spec does currently define the parameter as an inline enum:

          {
            "in": "query",
            "name": "recursionLevel",
            "description": "The recursion level of this request. The default is 'none', no recursion.",
            "required": false,
            "type": "string",
            "enum": [
              "none",
              "oneLevel",
              "oneLevelPlusNestedEmptyFolders",
              "full"
            ],
            "x-ms-enum": {
              "name": "VersionControlRecursionType",
              "values": [
                {
                  "value": "none",
                  "description": "Only return the specified item."
                },
                {
                  "value": "oneLevel",
                  "description": "Return the specified item and its direct children."
                },
                {
                  "value": "oneLevelPlusNestedEmptyFolders",
                  "description": "Return the specified item and its direct children, as well as recursive chains of nested child folders that only contain a single folder."
                },
                {
                  "value": "full",
                  "description": "Return specified item and all descendants"
                }
              ]
            }
          },