Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum collection properties are represented as strings #1845

Closed
Tracked by #1398
andrueastman opened this issue Sep 15, 2022 · 0 comments · Fixed by #1846
Closed
Tracked by #1398

Enum collection properties are represented as strings #1845

andrueastman opened this issue Sep 15, 2022 · 0 comments · Fixed by #1846
Assignees
Labels
fixed generator Issues or improvements relater to generation capabilities.

Comments

@andrueastman
Copy link
Member

Taking a look at part of the metadata for the microsoft.graph.conditionalAccessConditionSet type

microsoft.graph.conditionalAccessConditionSet:
      title: conditionalAccessConditionSet
      required:
        - '@odata.type'
      type: object
      properties:
        servicePrincipalRiskLevels:
          type: array
          items:
            $ref: '#/components/schemas/microsoft.graph.riskLevel'
          description: 'Service principal risk levels included in the policy. Possible values are: low, medium, high, none, unknownFutureValue.'
        signInRiskLevels:
          type: array
          items:
            $ref: '#/components/schemas/microsoft.graph.riskLevel'
          description: 'Sign-in risk levels included in the policy. Possible values are: low, medium, high, hidden, none, unknownFutureValue. Required.'
        userRiskLevels:
          type: array
          items:
            $ref: '#/components/schemas/microsoft.graph.riskLevel'
          description: 'User risk levels included in the policy. Possible values are: low, medium, high, hidden, none, unknownFutureValue. Required.'

The properties userRiskLevels , userRiskLevels and servicePrincipalRiskLevels are a collection of the microsoft.graph.riskLevel enum.

They are however generated as List as seen at the link below.

https://github.com/microsoftgraph/msgraph-beta-sdk-dotnet/blob/afc29699f21294613457e2e9ed5a7d7d3e88028f/src/Microsoft.Graph/Generated/Models/ConditionalAccessConditionSet.cs#L62

This looks to be caused by the function not looking up the type for Enums and defaulting to string when the schema is a collection type.

if (string.IsNullOrEmpty(type?.Name))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed generator Issues or improvements relater to generation capabilities.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant