swagger-api/swagger-codegen

Typescript: Dates Are Not Deserialized

オープン

#2,776 opened on 2016/05/04

 (18 件のコメント) (17 件のリアクション) (0 人の担当者)HTML (5,474 件のフォーク)batch import
Client: TypeScriptIssue: Bughelp wanted

Repository metrics

Stars
 (12,701 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド