microsoftgraph / microsoftgraph/msgraph-sdk-powershell
Fix beta Security OpenAPI schemas generating undefined C# types
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:
microsoft.graph.security.securityCopilot.prompt.inputs- References
microsoft.graph.Dictionary. microsoft.graph.Dictionaryis defined astype: objectwithadditionalProperties: { type: object }.
- References
microsoft.graph.security.detectionAction.responseActions[]- References
microsoft.graph.security.responseAction. microsoft.graph.security.responseActionis an emptytype: objectwithadditionalProperties: { type: object }.
- References
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:
MicrosoftGraphSecurityCopilotPromptMicrosoftGraphSecurityDetectionAction
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.inputsmicrosoft.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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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