Skip to content

Fix beta Security OpenAPI schemas generating undefined C# types #3708

Description

Problem

The refreshed beta Security OpenAPI document contains two free-form object schemas that AutoREST.PowerShell generates as the invalid C# type undefined.undefined:

  1. microsoft.graph.security.securityCopilot.prompt.inputs
    • References microsoft.graph.Dictionary.
    • microsoft.graph.Dictionary is defined as type: object with additionalProperties: { type: object }.
  2. microsoft.graph.security.detectionAction.responseActions[]
    • References microsoft.graph.security.responseAction.
    • microsoft.graph.security.responseAction is an empty type: object with additionalProperties: { type: object }.

The generated beta Security module fails C# compilation with errors such as:

error CS0246: The type or namespace name 'undefined' could not be found

Affected generated models include:

  • MicrosoftGraphSecurityCopilotPrompt
  • MicrosoftGraphSecurityDetectionAction

Required OpenAPI correction

Update these schemas to use concrete, generator-supported types. If these values are intentionally arbitrary JSON, model them using the supported free-form object representation rather than an object whose values are themselves untyped objects. The exact schema should reflect the API contract for:

  • Security Copilot prompt input values
  • Custom detection response actions

Temporary SDK workaround

PR #3701 removes only these two properties from AutoREST's in-memory OpenAPI document using directives in src/Security/Security.md:

  • microsoft.graph.security.securityCopilot.prompt.inputs
  • microsoft.graph.security.detectionAction.responseActions

This preserves the associated endpoints and other model properties while allowing beta Security generation and compilation to complete.

Completion criteria

  • Correct both schemas in the source OpenAPI transforms.
  • Confirm AutoREST.PowerShell generates valid C# types for both properties.
  • Remove the temporary property-removal directives from src/Security/Security.md.
  • Regenerate and build the beta Security module successfully.

Related: #3701

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions