Skip to content

Python doesn't honor x-ms-enum values field #2704

@matthchr

Description

@matthchr

According to here there is a values collection supported on enums, for specifying doc-strings for the individual enum values (among other things). But the generated Python code doesn't actually use these doc strings at all.

For example, this snippet of Swagger (from the Azure Batch swagger specification):

            "values": [
              {
                "value": "currentuser",
                "description": "Certificates should be installed to the CurrentUser certificate store.",
                "name": "currentUser"
              },
              {
                "value": "localmachine",
                "description": "Certificates should be installed to the LocalMachine certificate store.",
                "name": "localMachine"
              }
            ]
          }

generates this Python code:

class CertificateStoreLocation(Enum):
    current_user = "currentuser"
    local_machine = "localmachine"

It should generate something that looks like this:

class CertificateStoreLocation(Enum):
    """Certificates should be installed to the CurrentUser certificate store."""
    current_user = "currentuser"
    """Certificates should be installed to the LocalMachine certificate store."""
    local_machine = "localmachine"

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions