Azure / azure-sdk-for-rust

This repository is for the active development of the Azure SDK for Rust. For consumers of the SDK we recommend visiting Docs.rs and looking up the docs for any of libraries in the SDK.
MIT License
710 stars 246 forks source link

add AutoRust support for x-ms-enum #413

Open cataggar opened 3 years ago

cataggar commented 3 years ago

Add support to AutoRust for x-ms-enum. https://github.com/stankovski/AutoRest/blob/master/Documentation/swagger-extensions.md#x-ms-enum

Using the example from #412, this would result in a enum values named Global and Keys, which is much better.

specification\keyvault\data-plane\Microsoft.KeyVault\stable\7.2\rbac.json

    "RoleScope": {
      "type": "string",
      "description": "The role scope.",
      "enum": [
        "/",
        "/keys"
      ],
      "x-ms-enum": {
        "name": "RoleScope",
        "modelAsString": true,
        "values": [
          {
            "name": "Global",
            "value": "/",
            "description": "Global scope"
          },
          {
            "name": "Keys",
            "value": "/keys",
            "description": "Keys scope"
          }
        ]
      }
    },
johnbatty commented 2 years ago

Fyi I'm going to work on this...

cataggar commented 1 year ago

This is not fixed yet. Still shows: https://github.com/Azure/azure-sdk-for-rust/blob/e1896167cd7c2a8560adf27999623623cea8dcbc/services/svc/keyvault/src/package_7_4/models.rs#L2901-L2911