Skip to content

[Policy] SDK validation for TypeSpec swagger#54693

Draft
zedy-wj wants to merge 5 commits intoAzure:mainfrom
zedy-wj:wenjie-dev/policy
Draft

[Policy] SDK validation for TypeSpec swagger#54693
zedy-wj wants to merge 5 commits intoAzure:mainfrom
zedy-wj:wenjie-dev/policy

Conversation

@zedy-wj
Copy link
Member

@zedy-wj zedy-wj commented Dec 25, 2025

This is the SDK validation for Azure Policy.
TSP link: Azure/azure-rest-api-specs#38509.

Changes:

  • Update commit id and correct input file path in the autorest file.
  • Overloaded some methods that originally existed.
  • Renamed some API names according to the naming conversion.
  • Skipped operation: PolicyAssignments_ListForResource because duplicated methods were generated in the samples, issues: SDK Validation - Policy #54960.

@github-actions github-actions bot added the Mgmt This issue is related to a management package. label Dec 25, 2025
@zedy-wj zedy-wj requested a review from Copilot January 7, 2026 02:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Azure Policy SDK to validate against a new TypeSpec swagger specification. The primary changes include updating the commit ID and correcting input file paths in the autorest configuration, along with regenerating SDK code to use the new 2025-03-01 API version instead of the previous 2021-06-01/2022-06-01 versions.

Key Changes:

  • Updated autorest.md to reference new TypeSpec-based OpenAPI specifications (2025-03-01 policy API version)
  • Consolidated multiple policy-related input files into a single openapi.json file
  • Added support for policy definition/set definition versions and policy tokens
  • Regenerated all sample files and resource classes with updated API versions and file paths

Reviewed changes

Copilot reviewed 16 out of 145 changed files in this pull request and generated no comments.

Show a summary per file
File Description
autorest.md Updated input files to use consolidated 2025-03-01 openapi.json and new commit ID; added skipped operations and request path mappings
Sample files (multiple) Updated example definition paths from 2021-06-01/2022-06-01 to 2025-03-01; added new sample methods for policy versions and tokens
TenantResource.cs Added new methods for listing built-in policy definition/set definition versions
SubscriptionResource.cs Added methods for policy version listing and policy token acquisition
PolicySetDefinition/PolicyDefinition resources Added expand parameter and version collection support; updated API versions
New version resources Added new resource types for managing policy definition and set definition versions
PolicyAssignmentData.cs Updated base class reference to use fully qualified name

Generate sdk code from swagger

fix variable not exist error

fix some validation error

fix some validation error

Generate sdk code from swagger

fix some validation error

fix some validation error

fix and run sample tests

export api

regenerate by latest commit

update some api info
@zedy-wj zedy-wj force-pushed the wenjie-dev/policy branch from 7b3c9ee to 653421f Compare January 8, 2026 09:16
@zedy-wj zedy-wj marked this pull request as ready for review January 12, 2026 08:49
@ArthurMa1978
Copy link
Member

We don't need to merge this PR because Policy will be released by a new namespace

@zedy-wj zedy-wj marked this pull request as draft January 12, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge Mgmt This issue is related to a management package.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants