@@ -169,11 +169,11 @@ where
169169}
170170
171171trait ParameterDataExt {
172- fn render_type ( & self , name : & str , ts : & mut TypeSpace ) -> Result < String > ;
172+ fn render_type ( & self , proper_name : & str , name : & str , ts : & mut TypeSpace ) -> Result < String > ;
173173}
174174
175175impl ParameterDataExt for openapiv3:: ParameterData {
176- fn render_type ( & self , name : & str , ts : & mut TypeSpace ) -> Result < String > {
176+ fn render_type ( & self , proper_name : & str , name : & str , ts : & mut TypeSpace ) -> Result < String > {
177177 use openapiv3:: { SchemaKind , Type } ;
178178
179179 // Cleanup the name.
@@ -250,9 +250,20 @@ impl ParameterDataExt for openapiv3::ParameterData {
250250
251251 //println!("XXX min/max length");
252252 //}
253-
254253 match & st. format {
255- Item ( DateTime ) => "chrono::DateTime<chrono::Utc>" . to_string ( ) ,
254+ // FIXME: In [list_workflow_runs](https://docs.rs/octorust/latest/octorust/actions/struct.Actions.html#method.list_workflow_runs), the created
255+ // parameter is an optional DateTime as specified in github spec, but in practice, it is some date-time range of sort as specificed by the
256+ // [search syntax](https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates).
257+ // Convert this to an Option<&str> so the interface do not change for people not
258+ // using the parameter currently, if they were, it was not working as they expected unless they looked for a specified date-time.
259+ // https://github.com/github/rest-api-description/issues/2088
260+ Item ( DateTime ) => {
261+ if proper_name == "GitHub" && self . name == "created" {
262+ "Option<&str>" . to_string ( )
263+ } else {
264+ "chrono::DateTime<chrono::Utc>" . to_string ( )
265+ }
266+ }
256267 Item ( Date ) => "chrono::NaiveDate" . to_string ( ) ,
257268 Item ( Password ) => "&str" . to_string ( ) ,
258269 // TODO: as per the spec this is base64 encoded chars.
@@ -1419,7 +1430,6 @@ impl TypeSpace {
14191430 } else {
14201431 "" . to_string ( )
14211432 } ;
1422-
14231433 let mut s = sc. clone ( ) ;
14241434
14251435 // If we have an additional description and it is better than our original,
0 commit comments