Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

teowa opened this issue · comments

commented

The API specs is below:

"effectiveFrom": {
"type": "string",
"pattern": "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$",
"description": "Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix."
},

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}$"


"startTime": {
"type": "string",
"description": "Start time for recurrence."
},

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'."

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:

"effectiveFrom": {
"type": "string",
"pattern": "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$",
"description": "Scheduling effective from time. Date-Time in ISO-8601 format without timezone suffix."
},

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: -