fix(typescript-angular): Fix 'date' format transform to 'string'#4869
fix(typescript-angular): Fix 'date' format transform to 'string'#4869Xambey wants to merge 8 commits intoOpenAPITools:masterfrom
Conversation
| typeMapping.put("Map", "any"); | ||
| typeMapping.put("map", "any"); | ||
| typeMapping.put("date", "string"); | ||
| typeMapping.put("date", "Date"); |
There was a problem hiding this comment.
This should not be changed for alle typescript generators, as Date serialization/deserialization logic may vary.
Moreover, the angular generator does not implement a deserialization logic, so it should remain string
There was a problem hiding this comment.
@macjohnny Ok, but why a string in that case hasnt ISO format?
There was a problem hiding this comment.
The consuming client / the backend needs to generate strings in iso format
There was a problem hiding this comment.
The consuming client / the backend needs to generate strings in iso format
maybe then it is worth making a cast to ISO format? I don't mind having a type be a string if it is handled the same as the date format
There was a problem hiding this comment.
if you do not use ISO, how will you supply the timezone for the date?
There was a problem hiding this comment.
the string is not formatted by the client, it has to be passed by the consumer in the correct ISO format that the backend will understand.
./bin/(or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.shif updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).master,4.3.x,5.0.x. Default:master.Fix 'date' format type transform to 'string' type
@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11)