Skip to content

Commit

Permalink
fix live validation correctness WRITEONLY_PROPERTY_NOT_ALLOWED_IN_RES…
Browse files Browse the repository at this point in the history
…PONSEDaprSecretsCollection (#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 <naji@microsoft.com>
  • Loading branch information
najian and Nan Jiang authored Sep 30, 2022
1 parent cea4ad3 commit fd7a96f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@
}
},
"DaprSecretsCollection": {
"description": "Dapr component Secrets Collection ARM resource.",
"description": "Dapr component Secrets Collection for ListSecrets Action.",
"required": [
"value"
],
Expand All @@ -765,6 +765,23 @@
}
}
},
"DaprSecret": {
"description": "Dapr component Secret for ListSecrets Action",
"type": "object",
"properties": {
"name": {
"description": "Secret Name.",
"type": "string",
"readOnly": true
},
"value": {
"description": "Secret Value.",
"type": "string",
"x-ms-secret": true,
"readOnly": true
}
}
},
"ExtendedLocation": {
"type": "object",
"description": "The complex type of the extended location.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"body": {
"value": [
{
"name": "secret1"
"name": "secret1",
"value": "value1"
},
{
"name": "secret2"
"name": "secret2",
"value": "value2"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,23 +388,40 @@
}
},
"DaprSecretsCollection": {
"description": "Dapr component Secrets Collection ARM resource.",
"description": "Dapr component Secrets Collection for ListSecrets Action",
"required": [
"value"
],
"type": "object",
"properties": {
"value": {
"description": "Collection of secrets used by a Dapr component",
"description": "Collection of secrets for ListSecrets Action",
"type": "array",
"items": {
"$ref": "./CommonDefinitions.json#/definitions/Secret"
"$ref": "#/definitions/DaprSecret"
},
"x-ms-identifiers": [
"name"
]
}
}
},
"DaprSecret": {
"description": "Dapr component Secret for ListSecrets Action",
"type": "object",
"properties": {
"name": {
"description": "Secret Name.",
"type": "string",
"readOnly": true
},
"value": {
"description": "Secret Value.",
"type": "string",
"x-ms-secret": true,
"readOnly": true
}
}
}
},
"securityDefinitions": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"body": {
"value": [
{
"name": "secret1"
"name": "secret1",
"value": "value1"
},
{
"name": "secret2"
"name": "secret2",
"value": "value2"
}
]
}
Expand Down

0 comments on commit fd7a96f

Please sign in to comment.