microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Fix beta Security OpenAPI schemas generating undefined C# types

Open
#3,708 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the source OpenAPI transforms for the securityCopilot.prompt.inputs and detectionAction.responseActions schemas, then compare them with the generator-supported free-form object representation. Regenerate and build the beta Security module to confirm valid C# types, and remove the temporary property-removal directives from src/Security/Security.md.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, openapi, powershell
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.