Skip to content

Commit 66ab4f8

Browse files
committed
Update for optional action body
1 parent 64a5434 commit 66ab4f8

File tree

39 files changed

+300
-314
lines changed

39 files changed

+300
-314
lines changed

.github/actions/setup-node-install-deps/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ inputs:
77
default: 22.x
88
install-command:
99
description: 'Command to install dependencies'
10-
default: 'npm ci'
10+
default: 'npm i --no-package-lock --force'
1111
working-directory:
1212
description: 'Working directory'
1313
default: '.'

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"@azure-tools/spec-gen-sdk": "~0.6.1",
55
"@azure-tools/specs-shared": "file:.github/shared",
66
"@azure-tools/typespec-apiview": "0.7.2",
7-
"@azure-tools/typespec-autorest": "0.56.0",
7+
"@azure-tools/typespec-autorest": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg2Njc4MS9hcnRpZmFjdE5hbWUvcGFja2FnZXM1/content?format=file&subPath=%2Fazure-tools-typespec-autorest-0.57.0-pr-2674.20250514.10.tgz",
88
"@azure-tools/typespec-azure-core": "0.56.0",
9-
"@azure-tools/typespec-azure-portal-core": "0.56.0",
10-
"@azure-tools/typespec-azure-resource-manager": "0.56.0",
11-
"@azure-tools/typespec-azure-rulesets": "0.56.0",
9+
"@azure-tools/typespec-azure-portal-core": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg2Njc4MS9hcnRpZmFjdE5hbWUvcGFja2FnZXM1/content?format=file&subPath=%2Fazure-tools-typespec-azure-portal-core-0.57.0-pr-2674.20250514.10.tgz",
10+
"@azure-tools/typespec-azure-resource-manager": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg2Njc4MS9hcnRpZmFjdE5hbWUvcGFja2FnZXM1/content?format=file&subPath=%2Fazure-tools-typespec-azure-resource-manager-0.57.0-pr-2674.20250514.10.tgz",
11+
"@azure-tools/typespec-azure-rulesets": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDg2Njc4MS9hcnRpZmFjdE5hbWUvcGFja2FnZXM1/content?format=file&subPath=%2Fazure-tools-typespec-azure-rulesets-0.57.0-pr-2674.20250514.10.tgz",
1212
"@azure-tools/typespec-client-generator-cli": "0.21.0",
1313
"@azure-tools/typespec-client-generator-core": "0.56.2",
1414
"@azure-tools/typespec-liftr-base": "0.8.0",

specification/apicenter/ApiCenter.Management/ApiDefinition.tsp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ interface ApiDefinitions {
4444
importSpecification is ArmResourceActionAsync<
4545
ApiDefinition,
4646
ApiSpecImportRequest,
47-
ApiImportSuccess
47+
ApiImportSuccess,
48+
BodyParameter = {
49+
@doc("The content of the action request")
50+
@bodyRoot
51+
body: ApiSpecImportRequest;
52+
}
4853
>;
4954
@doc("Exports the API specification.")
5055
exportSpecification is ArmResourceActionAsync<

specification/apicenter/ApiCenter.Management/Service.tsp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ interface Services {
4747
exportMetadataSchema is ArmResourceActionAsync<
4848
Service,
4949
MetadataSchemaExportRequest,
50-
MetadataSchemaExportResult
50+
MetadataSchemaExportResult,
51+
BodyParameter = {
52+
@doc("The content of the action request")
53+
@bodyRoot
54+
body: MetadataSchemaExportRequest;
55+
}
5156
>;
5257
}

specification/apicenter/ApiCenter.Management/main.tsp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,6 @@ enum Versions {
103103
);
104104
@@clientName(Workspaces.createOrUpdate::parameters.resource, "payload");
105105

106-
#suppress "deprecated" "LEGACY - DO NOT COPY THIS DOESN'T MAKE SENSE - FIX"
107-
@@encodedName(ApiDefinitions.importSpecification::parameters.body,
108-
"application/json",
109-
"payload"
110-
);
111-
112-
@@encodedName(ApiDefinitions.exportSpecification::parameters.body,
113-
"application/json",
114-
"payload"
115-
);
116-
117-
@@clientName(ApiDefinitions.exportSpecification::parameters.body, "payload");
118-
119-
#suppress "deprecated" "LEGACY - DO NOT COPY THIS DOESN'T MAKE SENSE - FIX"
120-
@@encodedName(Services.exportMetadataSchema::parameters.body,
121-
"application/json",
122-
"payload"
123-
);
124-
125-
@@clientName(Services.exportMetadataSchema::parameters.body, "payload");
126-
127106
@@visibility(Azure.Core.Page.nextLink, Lifecycle.Read);
128107
@@visibility(Azure.Core.Page.value, Lifecycle.Read);
129108
/**

specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-03-15-preview/apicenter.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -617,14 +617,13 @@
617617
"pattern": "^[a-zA-Z0-9-]{3,90}$"
618618
},
619619
{
620-
"name": "payload",
620+
"name": "body",
621621
"in": "body",
622622
"description": "The content of the action request",
623623
"required": true,
624624
"schema": {
625625
"$ref": "#/definitions/MetadataSchemaExportRequest"
626-
},
627-
"x-ms-client-name": "body"
626+
}
628627
}
629628
],
630629
"responses": {
@@ -3137,14 +3136,13 @@
31373136
"pattern": "^[a-zA-Z0-9-]{3,90}$"
31383137
},
31393138
{
3140-
"name": "payload",
3139+
"name": "body",
31413140
"in": "body",
31423141
"description": "The content of the action request",
31433142
"required": true,
31443143
"schema": {
31453144
"$ref": "#/definitions/ApiSpecImportRequest"
3146-
},
3147-
"x-ms-client-name": "body"
3145+
}
31483146
}
31493147
],
31503148
"responses": {

specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2024-06-01-preview/apicenter.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -620,14 +620,13 @@
620620
"pattern": "^[a-zA-Z0-9-]{3,90}$"
621621
},
622622
{
623-
"name": "payload",
623+
"name": "body",
624624
"in": "body",
625625
"description": "The content of the action request",
626626
"required": true,
627627
"schema": {
628628
"$ref": "#/definitions/MetadataSchemaExportRequest"
629-
},
630-
"x-ms-client-name": "body"
629+
}
631630
}
632631
],
633632
"responses": {
@@ -3505,14 +3504,13 @@
35053504
"pattern": "^[a-zA-Z0-9-]{3,90}$"
35063505
},
35073506
{
3508-
"name": "payload",
3507+
"name": "body",
35093508
"in": "body",
35103509
"description": "The content of the action request",
35113510
"required": true,
35123511
"schema": {
35133512
"$ref": "#/definitions/ApiSpecImportRequest"
3514-
},
3515-
"x-ms-client-name": "body"
3513+
}
35163514
}
35173515
],
35183516
"responses": {

specification/apicenter/resource-manager/Microsoft.ApiCenter/stable/2024-03-01/apicenter.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,13 @@
428428
"pattern": "^[a-zA-Z0-9-]{3,90}$"
429429
},
430430
{
431-
"name": "payload",
431+
"name": "body",
432432
"in": "body",
433433
"description": "The content of the action request",
434434
"required": true,
435435
"schema": {
436436
"$ref": "#/definitions/MetadataSchemaExportRequest"
437-
},
438-
"x-ms-client-name": "body"
437+
}
439438
}
440439
],
441440
"responses": {
@@ -2948,14 +2947,13 @@
29482947
"pattern": "^[a-zA-Z0-9-]{3,90}$"
29492948
},
29502949
{
2951-
"name": "payload",
2950+
"name": "body",
29522951
"in": "body",
29532952
"description": "The content of the action request",
29542953
"required": true,
29552954
"schema": {
29562955
"$ref": "#/definitions/ApiSpecImportRequest"
2957-
},
2958-
"x-ms-client-name": "body"
2956+
}
29592957
}
29602958
],
29612959
"responses": {

specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/EvidenceResource.tsp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import "./ReportResource.tsp";
99
using TypeSpec.Rest;
1010
using Azure.ResourceManager;
1111
using TypeSpec.Http;
12-
using OpenAPI;
1312
using Azure.ClientGenerator.Core;
1413

1514
namespace Microsoft.AppComplianceAutomation;
@@ -47,8 +46,6 @@ interface Evidence {
4746
/**
4847
* Get the evidence metadata
4948
*/
50-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
51-
@operationId("Evidence_Get")
5249
get is ArmResourceRead<
5350
EvidenceResource,
5451
{
@@ -59,8 +56,6 @@ interface Evidence {
5956
/**
6057
* Create or Update an evidence a specified report
6158
*/
62-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
63-
@operationId("Evidence_CreateOrUpdate")
6459
createOrUpdate is ArmResourceCreateOrReplaceSync<
6560
EvidenceResource,
6661
{
@@ -72,15 +67,11 @@ interface Evidence {
7267
/**
7368
* Delete an existent evidence from a specified report
7469
*/
75-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
76-
@operationId("Evidence_Delete")
7770
delete is ArmResourceDeleteSync<EvidenceResource>;
7871

7972
/**
8073
* Returns a paginated list of evidences for a specified report.
8174
*/
82-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
83-
@operationId("Evidence_ListByReport")
8475
listByReport is ArmResourceListByParent<
8576
EvidenceResource,
8677
{
@@ -92,23 +83,21 @@ interface Evidence {
9283
/**
9384
* Download evidence file.
9485
*/
95-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
96-
@operationId("Evidence_Download")
9786
download is ArmResourceActionSync<
9887
EvidenceResource,
9988
EvidenceFileDownloadRequest,
100-
EvidenceFileDownloadResponse
89+
EvidenceFileDownloadResponse,
90+
BodyParameter = {
91+
@doc("Parameters for the query operation")
92+
@bodyRoot
93+
body: EvidenceFileDownloadRequest;
94+
}
10195
>;
10296
}
10397

10498
@@doc(Evidence.createOrUpdate::parameters.resource,
10599
"Parameters for the create or update operation"
106100
);
107-
@@encodedName(Evidence.download::parameters.body,
108-
"application/json",
109-
"parameters"
110-
);
111-
@@doc(Evidence.download::parameters.body, "Parameters for the query operation");
112101

113102
#suppress "deprecated" "LEGACY - DO NOT COPY - FIX"
114103
@@encodedName(Evidence.createOrUpdate::parameters.resource,

specification/appcomplianceautomation/AppComplianceAutomation.Management/resources/ReportResource.tsp

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ using Azure.ClientGenerator.Core;
99
using TypeSpec.Rest;
1010
using Azure.ResourceManager;
1111
using TypeSpec.Http;
12-
using OpenAPI;
13-
using Azure.Core;
1412

1513
namespace Microsoft.AppComplianceAutomation;
1614
/**
@@ -47,16 +45,12 @@ interface Report {
4745
/**
4846
* Get the AppComplianceAutomation report and its properties.
4947
*/
50-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
51-
@operationId("Report_Get")
5248
get is ArmResourceRead<ReportResource>;
5349

5450
/**
5551
* Create a new AppComplianceAutomation report or update an exiting AppComplianceAutomation report.
5652
*/
57-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
5853
#suppress "@azure-tools/typespec-azure-core/invalid-final-state" "MUST CHANGE ON NEXT UPDATE"
59-
@operationId("Report_CreateOrUpdate")
6054
@Azure.Core.useFinalStateVia("azure-async-operation")
6155
createOrUpdate is ArmResourceCreateOrReplaceAsync<
6256
ReportResource,
@@ -67,9 +61,7 @@ interface Report {
6761
/**
6862
* Update an exiting AppComplianceAutomation report.
6963
*/
70-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
7164
@patch(#{ implicitOptionality: false })
72-
@operationId("Report_Update")
7365
update is ArmCustomPatchAsync<
7466
ReportResource,
7567
ReportResourcePatch,
@@ -79,8 +71,6 @@ interface Report {
7971
/**
8072
* Delete an AppComplianceAutomation report.
8173
*/
82-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
83-
@operationId("Report_Delete")
8474
delete is ArmResourceDeleteWithoutOkAsync<
8575
ReportResource,
8676
Azure.ResourceManager.Foundations.BaseParameters<ReportResource>
@@ -89,8 +79,6 @@ interface Report {
8979
/**
9080
* Get the AppComplianceAutomation report list for the tenant.
9181
*/
92-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
93-
@operationId("Report_List")
9482
list is ArmResourceListByParent<
9583
ReportResource,
9684
{
@@ -102,31 +90,36 @@ interface Report {
10290
/**
10391
* Synchronize attestation record from app compliance.
10492
*/
105-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
106-
@operationId("Report_SyncCertRecord")
10793
syncCertRecord is ArmResourceActionAsync<
10894
ReportResource,
10995
SyncCertRecordRequest,
11096
SyncCertRecordResponse,
111-
Azure.ResourceManager.Foundations.BaseParameters<ReportResource>
97+
Azure.ResourceManager.Foundations.BaseParameters<ReportResource>,
98+
BodyParameter = {
99+
@doc("Parameters for synchronize certification record operation")
100+
@bodyRoot
101+
body: SyncCertRecordRequest;
102+
}
112103
>;
113104

114105
/**
115106
* Checks the report's nested resource name availability, e.g: Webhooks, Evidences, Snapshots.
116107
*/
117-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
118-
@operationId("Report_NestedResourceCheckNameAvailability")
119-
checkNameAvailability is ArmResourceActionSync<
108+
@action("checkNameAvailability")
109+
nestedResourceCheckNameAvailability is ArmResourceActionSync<
120110
ReportResource,
121111
Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest,
122-
Azure.ResourceManager.Foundations.CheckNameAvailabilityResponse
112+
Azure.ResourceManager.Foundations.CheckNameAvailabilityResponse,
113+
BodyParameter = {
114+
@doc("NameAvailabilityRequest object.")
115+
@bodyRoot
116+
body: Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest;
117+
}
123118
>;
124119

125120
/**
126121
* Fix the AppComplianceAutomation report error. e.g: App Compliance Automation Tool service unregistered, automation removed.
127122
*/
128-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
129-
@operationId("Report_Fix")
130123
fix is ArmResourceActionAsync<
131124
ReportResource,
132125
void,
@@ -137,8 +130,6 @@ interface Report {
137130
/**
138131
* Fix the AppComplianceAutomation report error. e.g: App Compliance Automation Tool service unregistered, automation removed.
139132
*/
140-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
141-
@operationId("Report_GetScopingQuestions")
142133
getScopingQuestions is ArmResourceActionSync<
143134
ReportResource,
144135
void,
@@ -149,8 +140,6 @@ interface Report {
149140
/**
150141
* Verify the AppComplianceAutomation report health status.
151142
*/
152-
#suppress "@azure-tools/typespec-azure-core/no-openapi" "For backward compatibility"
153-
@operationId("Report_Verify")
154143
verify is ArmResourceActionAsync<
155144
ReportResource,
156145
void,
@@ -173,19 +162,9 @@ interface Report {
173162
@@doc(Report.update::parameters.properties,
174163
"Parameters for the create or update operation"
175164
);
176-
@@doc(Report.syncCertRecord::parameters.body,
177-
"Parameters for synchronize certification record operation"
178-
);
179-
@@doc(Report.checkNameAvailability::parameters.body,
180-
"NameAvailabilityRequest object."
181-
);
165+
182166
#suppress "deprecated" "LEGACY - DO NOT COPY - FIX"
183167
@@encodedName(Report.update::parameters.properties,
184168
"application/json",
185169
"parameters"
186170
);
187-
188-
@@encodedName(Report.syncCertRecord::parameters.body,
189-
"application/json",
190-
"parameters"
191-
);

0 commit comments

Comments
 (0)