swagger-api/swagger-codegen

Typescript: Dates Are Not Deserialized

Open

#2,776 创建于 2016年5月4日

在 GitHub 查看
 (18 评论) (17 反应) (0 负责人)HTML (12,701 star) (5,474 fork)batch import
Client: TypeScriptIssue: Bughelp wanted

描述

If you have a property in a definition that is a string with date-time format, the typescript generated model makes that property a Date type. However, the response in the client is given verbatim. It never looks for date strings and actually transforms them in to Date objects. So the project will build, but fails at runtime if you try to access Date specific methods since it's actually a string.

I imagine this relates to: https://github.com/swagger-api/swagger-codegen/issues/1951

Since this PR focuses on deserializing dates in the response. I would suggest making those properties strings until deserialization is supported, otherwise the type checking isn't actually accurate.

贡献者指南