Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.69k stars 5.12k forks source link

AlertProcessingRule 2021-08-08 property EffectiveFrom pattern is not consistent with the service actually supported #19141

Open teowa opened 2 years ago

teowa commented 2 years ago

The API specs is below: https://github.com/Azure/azure-rest-api-specs/blob/3c18ef0c50ee228b81edf98ea1c192a70354943c/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/AlertProcessingRules.json#L539-L543

But using the below value in the request, which can match the given RegEx pattern:

effectiveFrom = "2022-01-01T01:02:03.0123"

Server response:

{
   "error": {
     "code": "BadRequest",
     "message": "Invalid input parameters: Wrong DateTime format of the parameter: 'effectiveFrom', with value: '2022-01-01T01:02:03.0123'. Expected date time format is 'yyyy'-'MM'-'dd'T'HH':'mm':'ss'."
   }
}

Test with empty string effectiveFrom = "", the same error returns Maybe the correct pattern for effectiveFrom and effectiveUntil should be "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$"


https://github.com/Azure/azure-rest-api-specs/blob/3c18ef0c50ee228b81edf98ea1c192a70354943c/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/AlertProcessingRules.json#L583-L586 Besides, startTime and endTime in above specs should have a pattern "^\\d{2}:\\d{2}:\\d{2}$" according to server response.

"Invalid input parameters: Wrong Time format of the parameter: 'startTime', with value: ''. Expected date time format is: 'HH':'mm':'ss'."
ghost commented 2 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @liadtal, @yairgil.

Issue Details
The API specs is below: https://github.com/Azure/azure-rest-api-specs/blob/3c18ef0c50ee228b81edf98ea1c192a70354943c/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-08-08/AlertProcessingRules.json#L539-L543 But using the below value in the request, which can match the given RegEx pattern: ``` effectiveFrom = "2022-01-01T01:02:03.0123" ``` Server response: ``` { "error": { "code": "BadRequest", "message": "Invalid input parameters: Wrong DateTime format of the parameter: 'effectiveFrom', with value: '2022-01-01T01:02:03.0123'. Expected date time format is 'yyyy'-'MM'-'dd'T'HH':'mm':'ss'." } } ``` Maybe the correct pattern should be `"^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}))$"`
Author: teowa
Assignees: -
Labels: `Service Attention`, `needs-triage`, `Alerts Management`
Milestone: -