Skip to content

Commit 3ed5da4

Browse files
oformaniukOleh Formaniuk
andauthored
Fixed Swagger correctness for SourceControls API (#25976)
* Fixed Swagger correctness for SourceControls API * Fix a typo * Fix CI errors * Fixed styling --------- Co-authored-by: Oleh Formaniuk <oformaniuk@microsoft.com>
1 parent 925d54f commit 3ed5da4

File tree

3 files changed

+63
-13
lines changed

3 files changed

+63
-13
lines changed

specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2023-10-01-preview/SourceControls.json

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"$ref": "../../../common/2.0/types.json#/parameters/WorkspaceName"
6161
},
6262
{
63-
"$ref": "#/parameters/RepoTypeParameter"
63+
"$ref": "#/parameters/RepositoryAccess"
6464
}
6565
],
6666
"responses": {
@@ -307,6 +307,11 @@
307307
"description": "The name of the repository.",
308308
"type": "string"
309309
},
310+
"installationId": {
311+
"description": "The installation id of the repository.",
312+
"type": "integer",
313+
"format": "int64"
314+
},
310315
"branches": {
311316
"description": "Array of branches.",
312317
"items": {
@@ -347,6 +352,9 @@
347352
}
348353
],
349354
"description": "Represents a SourceControl in Azure Security Insights.",
355+
"required": [
356+
"properties"
357+
],
350358
"properties": {
351359
"properties": {
352360
"description": "source control properties",
@@ -462,6 +470,34 @@
462470
}
463471
}
464472
},
473+
"RepositoryAccessObject": {
474+
"description": "Credentials to access repository.",
475+
"type": "object",
476+
"required": [
477+
"repositoryAccess"
478+
],
479+
"properties": {
480+
"repositoryAccess": {
481+
"description": "RepositoryAccess properties",
482+
"$ref": "#/definitions/RepositoryAccess",
483+
"x-ms-client-flatten": true
484+
}
485+
}
486+
},
487+
"RepositoryAccessProperties": {
488+
"description": "Credentials to access repository.",
489+
"type": "object",
490+
"required": [
491+
"properties"
492+
],
493+
"properties": {
494+
"properties": {
495+
"description": "RepositoryAccess properties",
496+
"$ref": "#/definitions/RepositoryAccessObject",
497+
"x-ms-client-flatten": true
498+
}
499+
}
500+
},
465501
"Repository": {
466502
"type": "object",
467503
"required": [
@@ -490,7 +526,6 @@
490526
}
491527
},
492528
"ServicePrincipal": {
493-
"readOnly": true,
494529
"type": "object",
495530
"description": "Service principal metadata.",
496531
"properties": {
@@ -508,6 +543,11 @@
508543
"description": "App id of service principal.",
509544
"type": "string",
510545
"readOnly": true
546+
},
547+
"credentialsExpireOn": {
548+
"format": "date-time",
549+
"description": "Expiration time of service principal credentials.",
550+
"type": "string"
511551
}
512552
}
513553
},
@@ -959,11 +999,7 @@
959999
"required": [
9601000
"repositoryAccess"
9611001
],
962-
"properties": {
963-
"repositoryAccess": {
964-
"$ref": "#/definitions/RepositoryAccess"
965-
}
966-
}
1002+
"$ref": "#/definitions/RepositoryAccessProperties"
9671003
},
9681004
"x-ms-parameter-location": "method"
9691005
}

specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2023-10-01-preview/examples/repositories/GetRepositories.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@
44
"repoType": "Github",
55
"subscriptionId": "d0cfe6b2-9ac0-4464-9919-dccaee2e48c0",
66
"resourceGroupName": "myRg",
7-
"workspaceName": "myWorkspace"
7+
"workspaceName": "myWorkspace",
8+
"repositoryAccess": {
9+
"etag": "\"0300bf09-0000-0000-0000-5c37296e0000\"",
10+
"properties": {
11+
"repositoryAccess": {
12+
"kind": "OAuth",
13+
"code": "939fd7c6caf754f4f41f",
14+
"state": "state",
15+
"clientId": "54b3c2c0-1f48-4a1c-af9f-6399c3240b73"
16+
}
17+
}
18+
}
819
},
920
"responses": {
1021
"200": {
@@ -13,6 +24,7 @@
1324
{
1425
"url": "https://api.github.com/repos/user/reponame",
1526
"fullName": "reponame",
27+
"installationId": 42424242,
1628
"branches": [
1729
"master",
1830
"develop"

specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2023-10-01-preview/examples/sourcecontrols/DeleteSourceControl.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
"workspaceName": "myWorkspace",
77
"sourceControlId": "789e0c1f-4a3d-43ad-809c-e713b677b04a",
88
"repositoryAccess": {
9-
"repositoryAccess": {
10-
"kind": "OAuth",
11-
"code": "939fd7c6caf754f4f41f",
12-
"state": "state",
13-
"clientId": "54b3c2c0-1f48-4a1c-af9f-6399c3240b73"
9+
"properties": {
10+
"repositoryAccess": {
11+
"kind": "OAuth",
12+
"code": "939fd7c6caf754f4f41f",
13+
"state": "state",
14+
"clientId": "54b3c2c0-1f48-4a1c-af9f-6399c3240b73"
15+
}
1416
}
1517
}
1618
},

0 commit comments

Comments
 (0)