Skip to content

Commit fd7a96f

Browse files
najianNan Jiang
and
Nan Jiang
authored
fix live validation correctness WRITEONLY_PROPERTY_NOT_ALLOWED_IN_RESPONSEDaprSecretsCollection (#20843)
Issue: ListSecrets action is intended to return secret, but the swagger used to define as write only model. Fix: new a readonly model for listSecrets response Co-authored-by: Nan Jiang <[email protected]>
1 parent cea4ad3 commit fd7a96f

File tree

4 files changed

+46
-8
lines changed

4 files changed

+46
-8
lines changed

specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/CommonDefinitions.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@
747747
}
748748
},
749749
"DaprSecretsCollection": {
750-
"description": "Dapr component Secrets Collection ARM resource.",
750+
"description": "Dapr component Secrets Collection for ListSecrets Action.",
751751
"required": [
752752
"value"
753753
],
@@ -765,6 +765,23 @@
765765
}
766766
}
767767
},
768+
"DaprSecret": {
769+
"description": "Dapr component Secret for ListSecrets Action",
770+
"type": "object",
771+
"properties": {
772+
"name": {
773+
"description": "Secret Name.",
774+
"type": "string",
775+
"readOnly": true
776+
},
777+
"value": {
778+
"description": "Secret Value.",
779+
"type": "string",
780+
"x-ms-secret": true,
781+
"readOnly": true
782+
}
783+
}
784+
},
768785
"ExtendedLocation": {
769786
"type": "object",
770787
"description": "The complex type of the extended location.",

specification/app/resource-manager/Microsoft.App/preview/2022-06-01-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
"body": {
1313
"value": [
1414
{
15-
"name": "secret1"
15+
"name": "secret1",
16+
"value": "value1"
1617
},
1718
{
18-
"name": "secret2"
19+
"name": "secret2",
20+
"value": "value2"
1921
}
2022
]
2123
}

specification/app/resource-manager/Microsoft.App/stable/2022-03-01/DaprComponents.json

+20-3
Original file line numberDiff line numberDiff line change
@@ -388,23 +388,40 @@
388388
}
389389
},
390390
"DaprSecretsCollection": {
391-
"description": "Dapr component Secrets Collection ARM resource.",
391+
"description": "Dapr component Secrets Collection for ListSecrets Action",
392392
"required": [
393393
"value"
394394
],
395395
"type": "object",
396396
"properties": {
397397
"value": {
398-
"description": "Collection of secrets used by a Dapr component",
398+
"description": "Collection of secrets for ListSecrets Action",
399399
"type": "array",
400400
"items": {
401-
"$ref": "./CommonDefinitions.json#/definitions/Secret"
401+
"$ref": "#/definitions/DaprSecret"
402402
},
403403
"x-ms-identifiers": [
404404
"name"
405405
]
406406
}
407407
}
408+
},
409+
"DaprSecret": {
410+
"description": "Dapr component Secret for ListSecrets Action",
411+
"type": "object",
412+
"properties": {
413+
"name": {
414+
"description": "Secret Name.",
415+
"type": "string",
416+
"readOnly": true
417+
},
418+
"value": {
419+
"description": "Secret Value.",
420+
"type": "string",
421+
"x-ms-secret": true,
422+
"readOnly": true
423+
}
424+
}
408425
}
409426
},
410427
"securityDefinitions": {

specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/DaprComponents_ListSecrets.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
"body": {
1313
"value": [
1414
{
15-
"name": "secret1"
15+
"name": "secret1",
16+
"value": "value1"
1617
},
1718
{
18-
"name": "secret2"
19+
"name": "secret2",
20+
"value": "value2"
1921
}
2022
]
2123
}

0 commit comments

Comments
 (0)