Skip to content

Commit

Permalink
Skip operations_list during generation (#5077)
Browse files Browse the repository at this point in the history
  • Loading branch information
live1206 authored Sep 20, 2024
1 parent 5fac408 commit 36e9caa
Show file tree
Hide file tree
Showing 3 changed files with 827 additions and 329 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ private static void RemoveInternalOperationFromInputClient(InputClient inputClie
var operationsToKeep = new List<InputOperation>();
foreach (var operation in inputClient.Operations)
{
// "internal" is set only we set access decorator in typespec, default null represents public
// TODO: Skip internal operations for Mgmt, we might need a better way to remove operations, tracking in https://github.com/Azure/typespec-azure/issues/964
if (operation.Accessibility == "public")
// operations_list has been covered in Azure.ResourceManager already, we don't need to generate it in the client
if (operation.CrossLanguageDefinitionId != "Azure.ResourceManager.Operations.list")
{
operationsToKeep.Add(operation);
}
Expand Down
2 changes: 2 additions & 0 deletions test/TestProjects/MgmtTypeSpec/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ using Azure.ResourceManager;
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
namespace MgmtTypeSpec;

interface Operations extends Azure.ResourceManager.Operations {}

/** The available API versions. */
enum Versions {
/** Azure Cosmos DB for Mongo vCore clusters api version 2024-03-01-preview. */
Expand Down
Loading

0 comments on commit 36e9caa

Please sign in to comment.