Description
Schema Inaccuracy
The created
parameter of actions/list-workflow-runs operation is currently set to "$ref": "#/components/parameters/created"
which has the following format:
"created": {
"name": "created",
"in": "query",
"required": false,
"schema": {
"type": "string",
"format": "date-time"
}
},
This causes openapi code generator to treat is as a datetime, resulting in queries which send the query parameter formatted as a date-time when the service expect a date-time range as specified in Query for dates which essentially makes this parameter unusable,or only usable when one wants to fetch items created at an exact time.
An example of such automatically generated API client is octorust and we can see that the created
parameter is expected to be a Datetime in list_workflow_runs.
Note: This likely apply to other operations that rely on similar syntax.
Expected
The format should either be left as a raw string, or being provided a custom format that consumers are up to handle natively, this way allowing a consumer to accept native date-time range and serialize to/deserialize from GH date-time range syntax.
Something along the lines of https://gist.github.com/chantra/ecc9a535ad8056eea6ef0a40bcc8a4df
Reproduction Steps
Currently, this causes queries to be formatted with created=2023-01-23T09:37:53-08:00
, resulting in only workflows created at that specific date being returned.
e.g:
curl --silent "https://api.github.com/repos/github/rest-api-description/actions/workflows/linter.yml/runs?created=$(date --iso-8601=seconds -d '1 day ago')" | jq .total_count
0
Preventing to capture queries such as:
$ curl --silent "https://api.github.com/repos/github/rest-api-description/actions/workflows/linter.yml/runs?created=>=$(date --iso-8601=seconds -d '1 day ago')" | jq .total_count
4